Java Oracle ojdbc8 12.2.0.1 被 Maven 禁止
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48096184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle ojdbc8 12.2.0.1 Forbidden by Maven
提问by sgrillon
Oracle ojdbc8 12.2.0.1 Forbiddenby Maven since December 2017, before that worked well. What configuration has changed on the Oracle repository (setting.xml)?
Oracle ojdbc8 12.2.0.1自 2017 年 12 月以来被 Maven禁止,在此之前运行良好。Oracle 信息库 (setting.xml) 上的哪些配置发生了变化?
Maven project: https://github.com/sgrillon14/MavenSampleOracleJdbc
Maven 项目:https: //github.com/sgrillon14/MavenSampleOracleJdbc
Full trace: https://travis-ci.org/sgrillon14/MavenSampleOracleJdbc
完整跟踪:https: //travis-ci.org/sgrillon14/MavenSampleOracleJdbc
采纳答案by Jean de Lavarene
It's possible that the Oracle Maven terms have changed. You may need to re-register on the Oracle Maven site: http://www.oracle.com/webapps/maven/register/license.htmlI tried your github script and it worked fine with me:
Oracle Maven 条款可能已更改。您可能需要在 Oracle Maven 站点上重新注册:http: //www.oracle.com/webapps/maven/register/license.html我试过你的 github 脚本,它对我很好:
$ mvn clean install --settings test/mvnsettings.xml
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mavensampleoraclejdbc 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ mavensampleoraclejdbc ---
[INFO] Deleting /Users/jean/Downloads/MavenOracle/MavenSampleOracleJdbc-master/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mavensampleoraclejdbc ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/jean/Downloads/MavenOracle/MavenSampleOracleJdbc-master/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ mavensampleoraclejdbc ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ mavensampleoraclejdbc ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/jean/Downloads/MavenOracle/MavenSampleOracleJdbc-master/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ mavensampleoraclejdbc ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavensampleoraclejdbc ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavensampleoraclejdbc ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/jean/Downloads/MavenOracle/MavenSampleOracleJdbc-master/target/mavensampleoraclejdbc-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ mavensampleoraclejdbc ---
[INFO] Installing /Users/jean/Downloads/MavenOracle/MavenSampleOracleJdbc-master/target/mavensampleoraclejdbc-1.0.0-SNAPSHOT.jar to /Users/jean/.m2/repository/com/github/sgrillon14/mavensampleoraclejdbc/1.0.0-SNAPSHOT/mavensampleoraclejdbc-1.0.0-SNAPSHOT.jar
[INFO] Installing /Users/jean/Downloads/MavenOracle/MavenSampleOracleJdbc-master/pom.xml to /Users/jean/.m2/repository/com/github/sgrillon14/mavensampleoraclejdbc/1.0.0-SNAPSHOT/mavensampleoraclejdbc-1.0.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.900 s
[INFO] Finished at: 2018-02-12T17:06:49+01:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
wagram:MavenSampleOracleJdbc-master jean$
回答by lance-java
Here's the underlying problem
这是根本问题
Access denied to: https://maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom , ReasonPhrase:Forbidden
I'm guessing you have the wrong username/password in your settings.xml
. Try hitting the URL in your browser and enter the username/password. Possibly your credentials have expired? Or maybe you have a different settings.xml
on travis than your localhost?
我猜你的settings.xml
. 尝试点击浏览器中的 URL 并输入用户名/密码。可能您的凭据已过期?或者,也许您settings.xml
对 travis 的使用与您的本地主机不同?
回答by p3consulting
version in the MANIFEST is 12.2.0.1.0 not 12.2.0.1 but still the problem
清单中的版本是 12.2.0.1.0 而不是 12.2.0.1 但问题仍然存在
"Content Server Request Failed Error Unable to download '(null)'. 'path:/Enterprise Libraries/content/maven/content/com/oracle/jdbc/ojdbc8/12.2.0.1/ojd??bc8-12.2.0.1.pom' does not exist. "
“Content Server Request Failed Error Unable to download '(null)'. 'path:/Enterprise Libraries/content/maven/content/com/oracle/jdbc/ojdbc8/12.2.0.1/ojd??bc8-12.2.0.1.pom ' 不存在。 ”
my credential are OK and got the problem on https://www.oracle.com/content/secure/maven/content/com/oracle/jdbc/ojdbc6/ojdbc6-11.2.0.4.0.pom(the URL you are redirected to when accessing to maven.oracle.com) too
我的凭据没问题,并且在https://www.oracle.com/content/secure/maven/content/com/oracle/jdbc/ojdbc6/ojdbc6-11.2.0.4.0.pom(重定向的 URL)上出现问题 访问 maven.oracle.com 时)
FYI: Latest attempt this Sat 6/01/2018 morning: OK, was able to download ojdbc8 POM from a browser.
仅供参考:本周六 6/01/2018 早上的最新尝试:好的,能够从浏览器下载 ojdbc8 POM。
回答by Nirmala
I tested for downloading ojdbc8.jar from 12.2.0.1. I was able to download without any issues. But, there is a warning. But, the warning is due to the missing *.md5 file in the maven repository. (We are looking into that issue)
我测试了从 12.2.0.1 下载 ojdbc8.jar。我可以毫无问题地下载。但是,有一个警告。但是,警告是由于 maven 存储库中缺少 *.md5 文件造成的。(我们正在研究这个问题)
Downloading:https://maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom[WARNING] Checksum validation failed, expected 3626be7f20ea523d9fd6aca576d5aba3f7afb3fe but is f1be766b419370110b86bd088a69c1bfcdca6989 for https://maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pomDownloaded:https://maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom(7 KB at 0.4 KB/sec)
下载:https://maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom[警告]校验和验证失败,预计3626be7f20ea523d9fd6aca576d5aba3f7afb3fe但f1be766b419370110b86bd088a69c1bfcdca6989为https://开头行家。 oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.pom下载地址:https : //maven.oracle.com/com/oracle/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2 .0.1.pom(7 KB,0.4 KB/秒)
回答by Rusi Popov
The Oracle Maven repository requires you to agree with the terms and conditions of using it. Thus, in order to provide this agreement:
Oracle Maven 信息库要求您同意使用它的条款和条件。因此,为了提供此协议:
- go to Oracle.com and login
- go to https://maven.oracle.com
the page shown shows:
... Directory browsing is not allowed on the Oracle Maven Repository.
Registration is required to access the Oracle Maven Repository. To register, please visit the registration site. ...
- 转到 Oracle.com 并登录
- 转到https://maven.oracle.com
显示的页面显示:
... Oracle Maven Repository 上不允许目录浏览。
需要注册才能访问 Oracle Maven Repository。要注册,请访问注册网站。...
The link to the "registration site" is actually http://www.oracle.com/webapps/maven/register/license.html
“注册站点”的链接其实是http://www.oracle.com/webapps/maven/register/license.html
where you have to accept the terms and conditions. This allows you to use the Oracle Maven repository.
您必须接受条款和条件。这允许您使用 Oracle Maven 存储库。
For further details on setting up Maven and published drivers, pleaase refer to
有关设置 Maven 和已发布驱动程序的更多详细信息,请参阅
回答by Vimala
- Since Oracle JDBC Driver is not in Maven repository, Download ojdbc8.jar and run the below command.
- 由于 Oracle JDBC 驱动程序不在 Maven 存储库中,请下载 ojdbc8.jar 并运行以下命令。
mvn install:install-file -Dfile=/home/cm/Videos/ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.1.0.2 -Dpackaging=jar
- Add this dependency in pom.xml
- 在 pom.xml 中添加此依赖项
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.1.0.2</version>
</dependency>
回答by Said Yusifli
If you don't have dependency add it otherwise for oracle, replace it with the following code:
如果您没有依赖项,则为 oracle 添加其他依赖项,请将其替换为以下代码:
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0</version>
</dependency>