Bamboo build failing with Oracle Maven dependency issue
Asked by Rohit:

Hello Team,

We have configured a bamboo plan referencing to bitbucket project. While doing maven build we are facing Oracle dependency issues. We configured Oracle Maven repository as suggested [Oracle Maven Setting](https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9010).

But still getting below error :

```
build	14-Jul-2018 03:49:58	[INFO] Scanning for projects...build	14-Jul-2018 03:49:59	[INFO] build	14-Jul-2018 03:49:59	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:49:59	[INFO] Building Mule cs-monitor-p Application 1.0.0-SNAPSHOTbuild	14-Jul-2018 03:49:59	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:00	[WARNING] The POM for com.oracle:ojdbc6:jar:12.1.0.2 is missing, no dependency information availablebuild	14-Jul-2018 03:50:00	[WARNING] The POM for com.mulesoft.weave:core:jar:1.2.1-SNAPSHOTS is missing, no dependency information availablebuild	14-Jul-2018 03:50:00	[WARNING] The POM for com.mulesoft.weave:flatfile:jar:1.2.1-SNAPSHOTS is missing, no dependency information availablebuild	14-Jul-2018 03:50:00	[WARNING] The POM for com.mulesoft.weave:excel:jar:1.2.1-SNAPSHOTS is missing, no dependency information availablebuild	14-Jul-2018 03:50:00	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:00	[INFO] BUILD FAILUREbuild	14-Jul-2018 03:50:00	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:00	[INFO] Total time: 1.455 sbuild	14-Jul-2018 03:50:00	[INFO] Finished at: 2018-07-14T03:50:00Zbuild	14-Jul-2018 03:50:00	[INFO] Final Memory: 19M/217Mbuild	14-Jul-2018 03:50:00	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:00	[ERROR] Failed to execute goal on project cs-monitor-p: Could not resolve dependencies for project com.mycompany:cs-monitor-p:mule:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.oracle:ojdbc6:jar:12.1.0.2, com.mulesoft.weave:core:jar:1.2.1-SNAPSHOTS, com.mulesoft.weave:flatfile:jar:1.2.1-SNAPSHOTS, com.mulesoft.weave:excel:jar:1.2.1-SNAPSHOTS: Failure to find com.oracle:ojdbc6:jar:12.1.0.2 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced -> [Help 1]build	14-Jul-2018 03:50:00	[ERROR] build	14-Jul-2018 03:50:00	[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.build	14-Jul-2018 03:50:00	[ERROR] Re-run Maven using the -X switch to enable full debug logging.build	14-Jul-2018 03:50:00	[ERROR] build	14-Jul-2018 03:50:00	[ERROR] For more information about the errors and possible solutions, please read the following articles:build	14-Jul-2018 03:50:00	[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionExceptionbuild	14-Jul-2018 03:50:01	[INFO] Scanning for projects...build	14-Jul-2018 03:50:02	[INFO] build	14-Jul-2018 03:50:02	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:02	[INFO] Building Mule cs-monitor-p Application 1.0.0-SNAPSHOTbuild	14-Jul-2018 03:50:02	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:03	[WARNING] The POM for com.oracle:ojdbc6:jar:12.1.0.2 is missing, no dependency information availablebuild	14-Jul-2018 03:50:03	[WARNING] The POM for com.mulesoft.weave:core:jar:1.2.1-SNAPSHOTS is missing, no dependency information availablebuild	14-Jul-2018 03:50:03	[WARNING] The POM for com.mulesoft.weave:flatfile:jar:1.2.1-SNAPSHOTS is missing, no dependency information availablebuild	14-Jul-2018 03:50:03	[WARNING] The POM for com.mulesoft.weave:excel:jar:1.2.1-SNAPSHOTS is missing, no dependency information availablebuild	14-Jul-2018 03:50:03	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:03	[INFO] BUILD FAILUREbuild	14-Jul-2018 03:50:03	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:03	[INFO] Total time: 1.715 sbuild	14-Jul-2018 03:50:03	[INFO] Finished at: 2018-07-14T03:50:03Zbuild	14-Jul-2018 03:50:03	[INFO] Final Memory: 21M/217Mbuild	14-Jul-2018 03:50:03	[INFO] ------------------------------------------------------------------------build	14-Jul-2018 03:50:03	[ERROR] Failed to execute goal on project cs-monitor-p: Could not resolve dependencies for project com.mycompany:cs-monitor-p:mule:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.oracle:ojdbc6:jar:12.1.0.2, com.mulesoft.weave:core:jar:1.2.1-SNAPSHOTS, com.mulesoft.weave:flatfile:jar:1.2.1-SNAPSHOTS, com.mulesoft.weave:excel:jar:1.2.1-SNAPSHOTS: Failure to find com.oracle:ojdbc6:jar:12.1.0.2 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced -> [Help 1]build	14-Jul-2018 03:50:03	[ERROR] build	14-Jul-2018 03:50:03	[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.build	14-Jul-2018 03:50:03	[ERROR] Re-run Maven using the -X switch to enable full debug logging.build	14-Jul-2018 03:50:03	[ERROR] build	14-Jul-2018 03:50:03	[ERROR] For more information about the errors and possible solutions, please read the following articles:build	14-Jul-2018 03:50:03	[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionExceptionsimple	14-Jul-2018 03:50:03	Failing task since return code of [/efs/bamboo/temp/IM-CSMON-JOB1-98-ScriptBuildTask-3780693728276670896.sh] was 1 while expected 0simple	14-Jul-2018 03:50:03	Finished task 'settings' with result: Failedsimple	14-Jul-2018 03:50:03	Running post build plugin 'NCover Results Collector'simple	14-Jul-2018 03:50:03	Running post build plugin 'Artifact Copier'simple	14-Jul-2018 03:50:03	Publishing an artifact: cs-monitor-p-1.0.0-SNAPSHOT
```

Below is Script configuration Task defined for Maven build :

```
cat <<EOF > muleSettings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
 <servers>
 <server>
 <id>maven.oracle.com</id>
 <username>${bamboo.oracleMavenRepoUser}</username>
 <password>${bamboo.oracleMavenRepoPassword}</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>
 <server>
 <id>mule-ee-releases</id>
 <username>${bamboo.nexusUser}</username>
 <password>${bamboo.nexusPassword}</password>
 </server>
 </servers>
</settings>
EOF

echo "==== muleSettings.xml ===="
cat muleSettings.xml
echo "========"

echo "==== Maven Version ===="
mvn -version
echo "========"


mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dpackaging=jar -Dversion=12.1.0.2 -Dfile=ojdbc.jar -DgeneratePom=true
mvn -Dmaven.wagon.provider.http=http.protocol.allow-circular-redirect clean install
mvn clean package -s muleSettings.xml

?
```

We are blocked at this movement and couldn't proceed with Continuous Integration.


Answers:
author: Rohit
body: More Bamboo logs

```
Downloading: http://repository.mulesoft.org/releases/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:36 Downloading: https://maven.oracle.com/org/apache/maven/plugins/maven-resources-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:37 build 17-Jul-2018 11:24:39 build 17-Jul-2018 11:24:39 [WARNING] Could not transfer metadata org.apache.maven.plugins:maven-resources-plugin/maven-metadata.xml from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Authorization Required.build 17-Jul-2018 11:24:39 Downloading: http://repository.mulesoft.org/releases/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:39 Downloading: https://maven.oracle.com/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:40 439/439 B   build 17-Jul-2018 11:24:40             build 17-Jul-2018 11:24:40 Downloaded: http://repository.mulesoft.org/releases/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml (439 B at 0.6 KB/sec)build 17-Jul-2018 11:24:41             build 17-Jul-2018 11:24:41 [WARNING] Could not transfer metadata org.apache.maven.plugins:maven-surefire-plugin/maven-metadata.xml from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Authorization Required.build 17-Jul-2018 11:24:41 Downloading: https://maven.oracle.com/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:41 Downloading: http://repository.mulesoft.org/releases/org/apache/maven/plugins/maven-install-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:41             build 17-Jul-2018 11:24:43             build 17-Jul-2018 11:24:43 [WARNING] Could not transfer metadata org.apache.maven.plugins:maven-install-plugin/maven-metadata.xml from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Authorization Required.build 17-Jul-2018 11:24:43 Downloading: https://maven.oracle.com/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:43 Downloading: http://repository.mulesoft.org/releases/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xmlbuild 17-Jul-2018 11:24:43             build 17-Jul-2018 11:24:45             build 17-Jul-2018 11:24:45 [WARNING] Could not transfer metadata org.apache.maven.plugins:maven-deploy-plugin/maven-metadata.xml from/to maven.oracle.com (https://maven.oracle.com): Not authorized , ReasonPhrase:Authorization Required.build 17-Jul-2018 11:24:46 Downloading: http://repo1.maven.org/maven2/com/oracle/ojdbc6/12.1.0.2/ojdbc6-12.1.0.2.pombuild 17-Jul-2018 11:24:46             build 17-Jul-2018 11:24:46 Downloading: http://repository.mulesoft.org/releases/com/oracle/ojdbc6/12.1.0.2/ojdbc6-12.1.0.2.pombuild 17-Jul-2018 11:24:47             build 17-Jul-2018 11:24:47 Downloading: https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/com/oracle/ojdbc6/12.1.0.2/ojdbc6-12.1.0.2.pombuild 17-Jul-2018 11:24:47             build 17-Jul-2018 11:24:47 Downloading: https://maven.oracle.com/com/oracle/ojdbc6/12.1.0.2/ojdbc6-12.1.0.2.pombuild 17-Jul-2018 11:24:50             build 17-Jul-2018 11:24:50 Downloading: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/12.1.0.2/ojdbc6-12.1.0.2.pombuild 17-Jul-2018 11:24:50             
```


author: Jeyanthan I
body: Hi Rohit,

Looking at the error, it looks like you have issues with your dependencies that is unrelated to Bamboo.

```
Failed to execute goal on project cs-monitor-p: Could not resolve dependencies for project com.mycompany:cs-monitor-p:mule:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.oracle:ojdbc6:jar:12.1.0.2, com.mulesoft.weave:core:jar:1.2.1-SNAPSHOTS, com.mulesoft.weave:flatfile:jar:1.2.1-SNAPSHOTS, com.mulesoft.weave:excel:jar:1.2.1-SNAPSHOTS: Failure to find com.oracle:ojdbc6:jar:12.1.0.2 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced -> [Help 1]
```

Did you try to run this script outside Bamboo via Command prompt? If it fails there, you may have to resolve that first and then rerun in Bamboo.

Cheers,  
Jey

comments: author: Rohit
body: [@Jeyanthan I](/t5/user/viewprofilepage/user-id/1124775) Maven build successfully runs on my local, but through bamboo it fails with above error.

Our project uses oracle ojdbc.jar, which is 3rd party driver and can't be added in maven repository.

So on our local we installed oracle dependency separately and this issue is gone.

Whereas in Bamboo server we need to access ojdbc as mentioned in Oracle Maven Respository link which i shared in my question.

So issue is Bamboo doesn't access the Oracle Maven respository which we created and given respective credentials. It always fails with Unauthorized issue though we Authorized it.

Hope you get my issue.

Thanks for dropping by.


author: Rohit
body: @\[deleted\] [@Foong](/t5/user/viewprofilepage/user-id/502088) [@Marcin Gardias](/t5/user/viewprofilepage/user-id/781649) [@Gabriel Ribeiro](/t5/user/viewprofilepage/user-id/352687) [@Robert W](/t5/user/viewprofilepage/user-id/1143519) [@Elza Carciu](/t5/user/viewprofilepage/user-id/492618) [@Sharan Busetty](/t5/user/viewprofilepage/user-id/1139743) [@Krishna Misra](/t5/user/viewprofilepage/user-id/1311294) [@Bill Carreon](/t5/user/viewprofilepage/user-id/1154216)

[@brainicorn](/t5/user/viewprofilepage/user-id/853343) [@Alexey Chystoprudov](/t5/user/viewprofilepage/user-id/781646) [@Jobin Kuruvilla \[Adaptavist\]](/t5/user/viewprofilepage/user-id/781455) [@Christian Glockner](/t5/user/viewprofilepage/user-id/527595) [@Jeyanthan I](/t5/user/viewprofilepage/user-id/1124775)

any help on this please?


Tags: bamboo