Search code examples
jenkinshudsonsbthudson-plugins

Build SBT project in Hudson


I'm trying to run a hudson job with the sbt plugin. I get this error:

Started by user anonymous
Checkout:workspace / /home/hudson/jobs/MyProject/workspace - hudson.remoting.LocalChannel@2d7bc967
Using strategy: Default
Last Built Revision: Revision 584f76d5dbd46e1fa0e32eb7e575aa53e724b1e5 (origin/master)
Checkout:workspace / /home/hudson/jobs/MyProject/workspace - hudson.remoting.LocalChannel@2d7bc967
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://[email protected]/MyProject.git
Commencing build of Revision 584f76d5dbd46e1fa0e32eb7e575aa53e724b1e5 (origin/master)
Checking out Revision 584f76d5dbd46e1fa0e32eb7e575aa53e724b1e5 (origin/master)
[workspace] $ /usr/lib/jvm/java-7-oracle/bin/java -Xmx512M -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=128m -Dsbt.log.noformat=true -jar /opt/hudson/plugin/sbt/bin/sbt-launch.jar clean compile test
java.io.IOException: No such file or directory
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1006)
    at xsbt.boot.Locks$.apply0(Locks.scala:35)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at xsbt.boot.Launch.locked(Launch.scala:240)
    at xsbt.boot.Launch.app(Launch.scala:149)
    at xsbt.boot.Launch.app(Launch.scala:147)
    at xsbt.boot.Launch$.run(Launch.scala:102)
    at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:36)
    at xsbt.boot.Launch$.launch(Launch.scala:117)
    at xsbt.boot.Launch$.apply(Launch.scala:19)
    at xsbt.boot.Boot$.runImpl(Boot.scala:44)
    at xsbt.boot.Boot$.main(Boot.scala:20)
    at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.io.IOException: No such file or directory
Finished: FAILURE

I followed this.

I can execute the same command java -Xmx512M -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=128m -Dsbt.log.noformat=true -jar /opt/hudson/plugin/sbt/bin/sbt-launch.jar clean compile test locally in my project directory and it works fine. Any idea?


Solution

  • Found the problem: the home directory of executing process (tomcat) was under the root as the owner. So, just a permission problem (as always)..