I've encountered an issue where the compile goal is failing with not being able to find javac. If I compile using play compile it succeeds. Here's the exception when using the Maven plugin to compile:
[INFO] Looking for 'play' in the System PATH
[info] Loading project definition from /var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/project
[info] Set current project to liveAdmin (in build file:/var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/)
[info] Updating {file:/var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/}liveAdmin...
[info] Done updating.
[info] Compiling 5 Scala sources and 16 Java sources to /var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/target/scala-2.9.1/classes...
[error] {file:/var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/}liveAdmin/compile:compile: java.io.IOException: Cannot run program "javac": java.io.IOException: error=2, No such file or directory
[error] Total time: 12 s, completed Sep 4, 2012 8:33:48 PM
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error during compilation
It feels like an environment issue where the compile goal is not inheriting $JAVA_HOME when using the plugin.
WORKAROUND:
I was able to determine the cause of the issue. For some reason when the compile goal invokes play to compile, commons exec does not inherit the environment setting for $JAVA_HOME. This is on CentOS Linux. This works fine on MacOS though.
The workaround was to modify the play script to set $JAVA_HOME and add $JAVA_HOME/bin to the $PATH.
ISSUE
I've encountered an issue where the compile goal is failing with not being able to find javac. If I compile using play compile it succeeds. Here's the exception when using the Maven plugin to compile:
[INFO] Looking for 'play' in the System PATH [info] Loading project definition from /var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/project [info] Set current project to liveAdmin (in build file:/var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/) [info] Updating {file:/var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/}liveAdmin... [info] Done updating.
[info] Compiling 5 Scala sources and 16 Java sources to /var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/target/scala-2.9.1/classes... [error] {file:/var/atlassian/data/bamboo/xml-data/build-dir/KIPA-TBT/mms/liveAdmin/}liveAdmin/compile:compile: java.io.IOException: Cannot run program "javac": java.io.IOException: error=2, No such file or directory [error] Total time: 12 s, completed Sep 4, 2012 8:33:48 PM [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error during compilation
It feels like an environment issue where the compile goal is not inheriting $JAVA_HOME when using the plugin.
WORKAROUND:
I was able to determine the cause of the issue. For some reason when the compile goal invokes play to compile, commons exec does not inherit the environment setting for $JAVA_HOME. This is on CentOS Linux. This works fine on MacOS though.
The workaround was to modify the play script to set $JAVA_HOME and add $JAVA_HOME/bin to the $PATH.