Hi Everyone
I am trying to build a sample java image using bamboo via a dockerfile. But I'm getting this error. We have added the proxy settings in settings.xml ~/.m2 folder.
Sending build context to Docker daemon 22.53kB
Step 1/8 : FROM maven:3.5.2-jdk-8-alpine AS MAVEN_TOOL_CHAIN
---> 293423a981a7
Step 2/8 : COPY pom.xml /tmp/
---> Using cache
---> b77d358f80b0
Step 3/8 : COPY src /tmp/src/
---> Using cache
---> d448db75d074
Step 4/8 : WORKDIR /tmp/
---> Using cache
---> 7c7a16ec65ab
Step 5/8 : RUN mvn package
---> Running in cc37fcc7488d
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.453 s
[INFO] Finished at: 2018-08-13T11:02:11Z
[INFO] Final Memory: 10M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Try again: Unknown host repo.maven.apache.org: Try again -> [Help 1]
Removing intermediate container cc37fcc7488d
The command '/bin/sh -c mvn package' returned a non-zero code: 1
Failing task since return code of [/usr/bin/docker build --force-rm=true --tag=ackris/java-sample /app/bamboosoftware-home/xml-data/build-dir/CIB-CID-JOB1] was 1 while expected 0
It looks like a clear proxy related issue. As aforementioned, we have already proxy related information in ~/.m2 folder. Is there something needs to be done on bamboo level which i am forgetting?
Please help me out as I really need to crack this asap.
PS: I am testing this out inside a corporate network, and we are behind a proxy. I am getting a value of 200 OK when I tried to telnet central maven repo.
I have the same problem. Did you solved it ?
Hi @xing chen
I guess you are also behind a corporate network. This was clearly a proxy permission related error.
Our organization has set rules such that Maven cannot contact remote maven repo to resolve external dependencies (such as JUnit, etc) which are used in a project.
So we switched our build tool to Apache Ant, and builds are happening without a hitch.
We are trying to improve our build structure by leveraging Apache Ivy + Sonatype Nexus.
I hope this helps.
Regards
Aditya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.