在哈德森建立SBT项目

时间:2014-04-23 15:11:14

标签: jenkins hudson sbt hudson-plugins

我正在尝试使用sbt插件运行hudson作业。我收到这个错误:

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://git@myhost.org/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

我跟着this

我可以在项目目录中本地执行相同的命令java -Xmx512M -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=128m -Dsbt.log.noformat=true -jar /opt/hudson/plugin/sbt/bin/sbt-launch.jar clean compile test,它可以正常工作。 有什么想法吗?

2 个答案:

答案 0 :(得分:1)

发现问题:执行进程的主目录(tomcat)在root下作为所有者。所以,只是一个权限问题(一如既往)..

答案 1 :(得分:0)

对我来说,我发现在Ubuntu 14.x和15.10下,当使用deb软件包源安装Jenkins CI时,尚未创建jenkins用户帐户的主目录。我可以在“/ etc / passwd”文件中看到jenkins帐户确实有一个主路径集,但它实际上并不存在。

我最终做的就是创建丢失的文件夹并将用户和组所有权分配给“jenkins”。

sudo mkdir /home/jenkins
sudo chown jenkins:jenkins /home/jenkins

重新开始工作,一切都很好。我现在可以看到“.ivy”和“.sbt”文件夹现已创建。

相关问题