Running Bamboo Ant Task on Linux CentOs

时间:2016-08-31 18:31:54

标签: java linux ant centos bamboo

We have been trying to successfully configure a ANT task within our bamboo build on a local agent, Linux CentOs 6.5.

We consistently are getting the following error:

Could not find test result reports in the /var/atlassian/application-data/bamboo/xml-data/build-dir/3080193/DIS-CF2016-JOB1 directory.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.tools.ant.launch.Launcher.  Program will exit.

Ant version is 1.7.1. It is installed at /usr/bin/ant . The lib directory for ant is located at /usr/share/ant/lib.

We have set the following environment variables for the bamboo user on the CentOs server

ANT_HOME=/usr/share/ant JAVA_HOME=/usr/lib/jvm/java

The java version is 1.6. Ant builds work fine from the command line on the server. Any ideas greatly appreciated.

1 个答案:

答案 0 :(得分:0)

不幸的是,这最终导致了竹子服务器没有接收到的环境设置问题。一旦服务器实际上由我们的IT小组重新启动,ant任务就开始在Bamboo构建中适当地为我们工作。

原始问题中指出,我们添加到用户个人资料中的两个环境设置是:

ANT_HOME=/usr/share/ant
JAVA_HOME=/usr/lib/jvm/java