Maven not picking JAVA_HOME correctly on Bamboo

1.1k Views Asked by At

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

There are 1 best solutions below

0
On

${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>