我正在尝试访问Oracle的存储库. Oracle并不容易.但是,我试图遵循Oracle提供的
the documentation.
我有:
>在我的系统上批准了the licensing agreement(如果需要设置某种类型的cookie).
>将M2_HOME和MAVEN_HOME设置为/usr/share / apache-maven.
>创建了一个Oracle帐户.
>将Oracle Repository添加到我的settings.xml文件中.
>下载wagon-http 2.8并将其放入我的$M2_HOME / libs / ext目录.
>生成主密码并将其放在$HOME / .m2 / settings-security.xml中
>生成加密密码.
>将Oracle Maven存储库添加到我的$HOME / .m2 / settings.xml文件as specified中.
>已配置HTTP Wagon并将其添加到我的$HOME / .m2 / settings.xml文件中.
我的项目POM看起来像这样:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.vegicorp</groupId> <artifactId>testMe</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>testMe</name> <url>http://maven.apache.org</url> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.10</version> <executions> <execution> <id>copy-dependencies</id> <phase>process-resources</phase> <goals> <goal>copy-dependencies</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>wls-api</artifactId> <version>12.1.2</version> </dependency> </dependencies> </project>
我的settings.xml如下所示:
<?xml version="1.0" encoding="UTF-8"?> <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <servers> <server> <username>qazwart</username> <password>swordfish</password> <id>central</id> </server> <server> <username>qazwart</username> <password>swordfish</password> <id>snapshots</id> </server> <server> <id>maven.oracle.com</id> <username>qazwart@foo.com</username> <password>{swordfish=}</password> <configuration> <basicAuthScope> <host>ANY</host> <port>ANY</port> <realm>OAM 11g</realm> </basicAuthScope> <httpConfiguration> <all> <params> <property> <name>http.protocol.allow-circular-redirects</name> <value>%b,true</value> </property> </params> </all> </httpConfiguration> </configuration> </server> </servers> <profiles> <profile> <repositories> <repository> <id>maven.oracle.com</id> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> <url>https://maven.oracle.com</url> <layout>default</layout> </repository> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>libs-release</name> <url>http://repo.vegicorp.net/artifactory/libs-release</url> </repository> <repository> <snapshots /> <id>snapshots</id> <name>libs-snapshot</name> <url>http://repo.vegicorp.net/artifactory/libs-snapshot</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>maven.oracle.com</id> <url>https://maven.oracle.com</url> </pluginRepository> <pluginRepository> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>plugins-release</name> <url>http://repo.vegicorp.net/artifactory/plugins-release</url> </pluginRepository> <pluginRepository> <snapshots /> <id>snapshots</id> <name>plugins-snapshot</name> <url>http://repo.vegicorp.net/artifactory/plugins-snapshot</url> </pluginRepository> </pluginRepositories> <id>artifactory</id> </profile> </profiles> <activeProfiles> <activeProfile>artifactory</activeProfile> </activeProfiles> </settings>
当我运行Maven时,我得到了这个:
$mvn clean package [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building testMe 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: https://maven.oracle.com/commons-io/commons-io/2.4/commons-io-2.4.pom Downloading: http://repo.vegicorp.net/artifactory/libs-release/commons-io/commons-io/2.4/commons-io-2.4.pom Downloaded: http://repo.vegicorp.net/artifactory/libs-release/commons-io/commons-io/2.4/commons-io-2.4.pom (10 KB at 69.4 KB/sec) Downloading: https://maven.oracle.com/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom Downloading: http://repo.vegicorp.net/artifactory/libs-release/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom Downloading: http://repo.vegicorp.net/artifactory/libs-snapshot/com/oracle/wls-api/12.1.2/wls-api-12.1.2.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.787 s [INFO] Finished at: 2015-06-15T16:37:56-04:00 [INFO] Final Memory: 9M/156M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project testMe: Could not resolve dependencies for project com.vegicorp:testMe:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.oracle:wls-api:jar:12.1.2: Failed to read artifact descriptor for com.oracle:wls-api:jar:12.1.2: Could not transfer artifact com.oracle:wls-api:pom:12.1.2 from/to maven.oracle.com (https://maven.oracle.com): Not authorized,ReasonPhrase:Unauthorized. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions,please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
虽然我接受了许可协议并使用了我创建的帐户,但似乎我无法访问Oracle存储库.有什么我想念的吗?如果我在我的pom.xml中删除对wls-api.jar的引用,它就可以了.
从您的settings.xml我可以看到您使用Artifactory.为什么不将Oracle的存储库定义为Artifactory中的远程存储库?这将使访问更容易.
Here’s a simple guide on how to do so.
原文链接:https://www.f2er.com/oracle/205205.html当然,还有here’s the official user guide on it.
我在Bintray Bintray和 [artifactory]后面的公司,有关详情和链接,请参阅my profile.