1
votes

We run a project using maven, and it works locally, but failed on Bamboo. Here is the error message:

error 10-Jun-2015 08:59:00 Automatic Maven plan dependencies processing failed: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs: [ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${java.home}/../lib/tools.jar @ org.jboss:jboss-parent:11, D:\maven_repository.m2\org\jboss\jboss-parent\11\jboss-parent-11.pom, line 171, column 21

It seems that Bamboo does not pick the JAVA_HOME correctly, how can I solve this problem, does anyone has a solution?

Thanks!

1
unix or window? Can you print your java path in shell? #!/bin/sh export JAVA_HOME=YOUR_JAVA_LOCATION - Sheetal Mohan Sharma
It is on windows. ECHO %JAVA_HOME%: C:\Java\jdk1.7.0_76 - Yvonne Ye
The path is supposed to be overridden with a system property com.sun.tools.path. But putting this in settings.xml doesn't help the Dependency Processor to resolve the path. Strangely it resolves the value from the default property in the jboss-parent-11.pom - Maddin
did you configure the available JDK in the server capabilities or the agent capabilities? And then choose which jdk to use in the build plan? It's a CI server I would not rely on system properties for builds. Those may change. - wemu

1 Answers

0
votes

${java.home}/../lib/tools.jar is not read by bamboo, it conflicts with one in jboss. Exclude jdk or specify which to use before you start bamboo like vm "Pathto\JDK6\bin"

Or

Add this to pom.xml to exclude tools.jar:

       <dependency>
       <groupId>com.sun</groupId>
        <artifactId>tools</artifactId>
        version>1.6</version>
        <scope>system</scope>
       <systemPath>Path to\Java\jdk1.xxx\lib\tools.jar</systemPath>
   </dependency>