mule maven dependency issue - maven

I have an existing api which i need to work on . ( Mule 3 )
when I try and do a mvn clean install it fails with this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-
plugin:2.10:unpack (unpack) on project xyz: Unable to resolve artifact.:
Could not transfer artifact ORGID:xyz:zip:fat-raml:1.0.2 from/to
springio (http://repo.spring.io/libs-release): Failed to transfer file:
http://repo.spring.io/libs-release/ORGID/xyz/1.0.2/xyz-1.0.2-fat-raml.zip.
Return code is: 308 , ReasonPhrase:Permanent Redirect.
[ERROR] ORGID:xyz:zip:1.0.2
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] MuleRepositoryEE (https://repository.mulesoft.org/nexus-
ee/content/repositories/releases-ee/, releases=true, snapshots=false),
[ERROR] MuleRepository
(https://repository.mulesoft.org/nexus/content/repositories/releases/, releases=true,
snapshots=false),
[ERROR] AnypointExchangeRepository
(https://maven.anypoint.mulesoft.com/api/v2/organizations/ORGID/maven, releases=true,
snapshots=true),
[ERROR] springio (http://repo.spring.io/libs-release, releases=true, snapshots=true),
[ERROR] Central (http://repo1.maven.org/maven2/, releases=true, snapshots=true),
[ERROR] mulesoft-releases (http://repository.mulesoft.org/releases/, releases=true,
snapshots=true),
[ERROR] mule-ee-releases (https://repository-
master.mulesoft.org/nexus/content/repositories/releases-ee/, releases=true,
snapshots=true),
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR] -> [Help 1]
The relevant plugin is :
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>ORGID</groupId>
<artifactId>xyz</artifactId>
<version>1.0.2</version>
<type>zip</type>
<classifier>fat-raml</classifier>
<overWrite>true</overWrite>
<outputDirectory>src/main/api/</outputDirectory>
<includes>**/*</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
The repository section in pom is :
<repositories>
<repository>
<id>springio</id>
<name>springio</name>
<url>http://repo.spring.io/libs-release</url>
<layout>default</layout>
</repository>
<repository>
<id>Central</id>
<name>Central</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>AnypointExchangeRepository</id>
<name>AnypointExchangeRepository</name>
<url>https://maven.anypoint.mulesoft.com/api/v2/organizations/ORGID/maven</url>
<layout>default</layout>
</repository>
<repository>
<id>mule-ee-releases</id>
<name>MuleEE Releases Repository</name>
<url>https://repository-master.mulesoft.org/nexus/content/repositories/releases-
ee/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-release</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>http://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>AnypointExchangeRepository</id>
<name>AnypointExchangeRepository</name>
<url>https://maven.anypoint.mulesoft.com/api/v1/organizations/ORGID/maven</url>
<layout>default</layout>
</repository>
</distributionManagement>
I am not sure why maven is trying to find raml in spring repository ? when it should find it in the ORGID repo ?
Does the order of the repositories need to change ?

The permanent redirect error may be caused because some of the repositories are being defined in you pom with HTTP URLs (ie http://...). Most repositories these days use HTTPS because of security reasons and redirect the HTTP requests. If Maven doesn't follow redirects it fails the build. Try using HTTPS URLs for all the repositories.

Related

Maven not using configured repositories to resolve all dependencies

Hello I am trying to build a jar using maven behind a corporate proxy with our own artifactory server.
We are building using docker gitlab runners and I am using the maven:3-jdk-8 image which is running Apache Maven 3.5.4.
The build starts fine by downloading the dependencies from our artifactory but when the maven-assembly-plugin tries to package our output into a jar I get the following error in debug mode:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (package-jar-with-dependencies) on project <my-project>: Failed to create assembly: Unable to resolve dependencies for assembly 'jar-with-dependencies': Failed to resolve dependencies for assembly: Unable to get dependency information for org.hibernate.validator:hibernate-validator:jar:6.0.13.Final: Failed to process POM for org.hibernate.validator:hibernate-validator:jar:6.0.13.Final: Non-resolvable import POM: Could not transfer artifact org.jboss.shrinkwrap:shrinkwrap-bom:pom:1.2.3 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known
[ERROR] org.hibernate.validator:hibernate-validator:jar:6.0.13.Final
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (https://artifactory.corp.net/, releases=true, snapshots=false)
[ERROR] Path to dependency:
[ERROR] 1) <my-project>
[ERROR] 2) org.springframework.boot:spring-boot-starter-web:jar:2.1.0.RELEASE: Unknown host repo.maven.apache.org: Name or service not known
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (package-jar-with-dependencies) on project <my-project>: Failed to create assembly: Unable to resolve dependencies for assembly 'jar-with-dependencies'
The glaring issue would seem to be that maven is trying to retrieve hibernate-validator from repo.maven.apache.org rather than my local corporate artifactory.
I have verified that the jar in question does indeed exist in my artifactory. I have built the project locally (outside of docker maven version 3.6.1 bundled with Intellij) with identical settings and didn't have any problems.
Any ideas what I'm doing wrong?
Some possibly useful files
The effective settings generated by help:effective-settings
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<localRepository>path-to-my-repo</localRepository>
<servers>
<server>
<username>username</username>
<password>***</password>
<id>central</id>
</server>
<server>
<username>username</username>
<password>***</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>Artifactory</name>
<url>https://artifactory.corp.net/</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
<pluginGroups>
<pluginGroup>org.apache.maven.plugins</pluginGroup>
<pluginGroup>org.codehaus.mojo</pluginGroup>
</pluginGroups>
</settings>
The plugin configuration from the pom file
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>package-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>the.main.class</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
It is very likely that this is the result of a missing mirror configuration in the settings.xml.
If you want to send every request to your artifactory, you need to specify it as a mirror. Otherwise, repository definitions from POMs may be used as well.

Failure to find the jar file on nexus repository, was cashed in the local repository

I have faced with a next problem:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run (default) on project mdw: Execution default of goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failure to find com.oracle:ojdbc7:jar:12.1.0.2 in **Here nexus url** was cached in the local repository, resolution will not be reattempted until the update interval of eict-plugins has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run (default) on project mdw: Execution default of goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failure to find com.oracle:ojdbc7:jar:12.1.0.2 in **Here nexus url** was cached in the local repository, resolution will not be reattempted until the update interval of eict-plugins has elapsed or updates are forced
when maven building my project.
How can it be resolved, any suggestions ?
I tried looking and could not find an oracle version of ojdbc7. Could you try with the below and see if this helps.
<dependency>
<groupId>com.github.noraui</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2</version>
</dependency>
This artefact is available only on Oracle repository , to let maven download it you must declare the Oracle repository in your pom.xml :
<dependencies>
.............
<dependecy>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
<dependency>
.............
</dependencies>
<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>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven.oracle.com</id>
<url>https://maven.oracle.com</url>
</pluginRepository>
</pluginRepositories>
You must have an Oracle account to be authenticated for the download, add this in of your settings.xml file :
<server>
<id>maven.oracle.com</id>
<username>your_oracle_username</username>
<password>your_oracle_password</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>

Dependencies work fine in maven but not in sbt

In my scala project I have a dependency that works fine in my maven project, but throws an error in my sbt project.
In this specific case the dependency in my build.sbt is:
"com.sksamuel.elastic4s" % "elastic4s-xpack-security_2.11" % "5.1.5"
while in my pom.xml:
[...]
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.11.8</scala.version>
<scala.compat.version>2.11</scala.compat.version>
<spark.version>2.1.0</spark.version>
</properties>
[...]
<repositories>
<repository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
<repository>
<id>elasticsearch-releases</id>
<url>https://artifacts.elastic.co/maven</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.sksamuel.elastic4s</groupId>
<artifactId>elastic4s-xpack-security_${scala.compat.version}</artifactId>
<version>5.1.5</version>
</dependency>
[...]
and the error shown is:
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.elasticsearch.client#x-pack-transport;5.1.1: not found
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.elasticsearch.client#x-pack-transport;5.1.1: not found
[error] Total time: 13 s, completed Mar 1, 2017 4:40:59 PM</pre><br/>See complete log in /Users/salvob/Library/Logs/IdeaIC2016.3/sbt.last.log
in fact the dependency doesn't exist.
But my question here is: Why in maven this issue doesn't show up? What does happen in maven that it doesn't in SBT ?
Add to build.sbt:
resolvers in ThisBuild += "elastic" at "https://artifacts.elastic.co/maven"
See Elastic documentation for gradle:
// Add the Elasticsearch Maven Repository
maven {
url "https://artifacts.elastic.co/maven"
}

Error building with Service Now connector v5.0.0 for Mule 3.7.1

I've been trying to do some tests with the new ServiceNow connector and Mule 3.7.1 but when I try to build the project and run it, it fails with the following error:
Failed to execute goal on project xxx: Could not resolve dependencies for project xxx:mule:0.0.1-SNAPSHOT: Failed to collect dependencies at org.mule.modules:mule-module-servicenow:jar:5.0.0: Failed to read artifact descriptor for org.mule.modules:mule-module-servicenow:jar:5.0.0: Could not transfer artifact org.mule.modules:mule-module-servicenow:pom:5.0.0 from/to mule-ee-releases (https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/): 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
I believe I have added the correct information into the correct sections in pom.xml
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-servicenow</artifactId>
</inclusion>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-servicenow</artifactId>
<version>5.0.0</version>
</dependency>
<repository>
<id>mulesoft-releases1</id>
<name>MuleSoft Repository</name>
<url>http://repository-master.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-snapshots1</id>
<name>MuleSoft Snapshot Repository</name>
<url>http://repository-master.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
I had to change the id of the two new repositories, since my pom already had repositories of those id's.
Can anyone shed any light on this for me?
Do you have the EE maven credentials set settings.xml? I was able to build an empty application using mule-module-servicenow with the following auto-generated (by dragging the connector from Anypoint pallet onto canvas) repositories:
<repositories>
<repository>
<id>Central</id>
<name>Central</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-snapshots</id>
<name>MuleSoft Snapshots Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
<repository>
<id>mule-ee-releases</id>
<name>MuleEE Releases Repository</name>
<url>https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-release</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>http://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

Trying to access Oracle's Maven repository

I'm attempting to access Oracle's repository. Oracle doesn't make it easy. However, I'm attempting to follow the documentation that Oracle provided.
I've:
Approved the licensing agreement on my system (in case there's some sort of cookie that needs to be set).
Set both M2_HOME and MAVEN_HOME to /usr/share/apache-maven.
Created an Oracle account.
Added the Oracle Repository to my settings.xml file.
Downloaded wagon-http 2.8 and put it in my $M2_HOME/libs/ext directory.
Generated a master password and put it in $HOME/.m2/settings-security.xml
Generated an encrypted password.
Added the Oracle Maven Repository to my $HOME/.m2/settings.xml file as specified.
Configured HTTP Wagon and added that to my $HOME/.m2/settings.xml file.
My project POM looks like this:
<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>
My settings.xml looks like this:
<?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>
When I run Maven, I get this:
$ 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
It appears that I don't have access to the Oracle repository although I accepted the licensing agreement and am using the account I've created. Is there something I'm missing? If I remove the reference to wls-api.jar in my pom.xml, it works.
From your settings.xml I can see that you use Artifactory. Why won't you define Oracle's repository as a remote in Artifactory? That will make the access much easier. Here's a simple guide on how to do so.
And, of course, here's the official user guide on it.
I am with JFrog, the company behind Bintray and [artifactory], see my profile for details and links.
For anybody that has spent any time fighting with this ... make sure that the ID of the oracle repository in your POM is the same as the ID of the server defined in your Settings.xml.
This is not documented anywhere but it appears that maven just does not request authorization if these IDs do not match. It does not attempt it based upon the URL as other solutions appear to suggest.
I think you missed accepting the Oracle Maven repository terms and conditions. https://www.oracle.com/webapps/maven/register/license.html

Resources