重启Tomcat后Jenkins Build失败

时间:2012-11-29 15:20:26

标签: build jenkins hudson integration continuous

我建立了一个蚂蚁项目并成功建立了一个项目。

Started by user anonymous
Building in workspace /home/myusername/jenkins/workspace/ctascweb
[ctascweb] $ cvs -q -z3 update -PdC -r ctascweb-development-3_3_8 -D "Wednesday, November 28, 2012 10:20:13 PM UTC"
? ROOT.war
? build
U src/stdy/analyze/LoadSubjects.java
$ computing changelog
[ctascweb] $ ant -file build_hudson.xml
Buildfile: build_hudson.xml

init:
     [echo] Base Directory : /home/myusername/jenkins/workspace/ctascweb 

gen-footer:

compile-ctpm:
     [echo] Compiling ctpm files
    [javac] Compiling 1 source file to /home/myusername/jenkins/workspace/ctpm/bin

generate-ctpm-jar:
     [echo] Building CTPM jar file
      [jar] Building jar: /home/myusername/jenkins/workspace/ctpm/build/ctpm.jar

compile-ctascweb:
     [echo] Compiling ctascweb files
    [javac] Compiling 1 source file to /home/myusername/jenkins/workspace/ctascweb/build/classes
    [mkdir] Created dir: /home/myusername/jenkins/workspace/ctascweb/build/classes/resource

build-ctascweb-war:
     [echo] Building WAR file for ctascweb
      [war] Building war: /home/myusername/jenkins/workspace/ctascweb/ROOT.war
     [echo] Nov-28-2012 05:20:48

BUILD SUCCESSFUL
Total time: 7 seconds
Archiving artifacts
Finished: SUCCESS

我关闭了我的Tomcat并回来了下一个工作。我没有对我的配置进行任何更改,并再次启动构建,并且构建失败。

Started by user anonymous
Building in workspace /home/myusername/jenkins/jobs/ctascweb/workspace
[ctascweb] $ cvs -Q -z3 -d :pserver:myusername:pwd@5.0.0.146:/CVS_RESP01 co -P -r ctascweb-development-3_3_8 -d workspace -D "Thursday, November 29, 2012 2:41:16 PM UTC" ctascweb
$ computing changelog
[workspace] $ ant -file build_hudson.xml
Buildfile: build_hudson.xml

init:
    [mkdir] Created dir: /home/myusername/jenkins/jobs/ctascweb/workspace/build/classes
     [echo] Base Directory : /home/myusername/jenkins/jobs/ctascweb/workspace 

gen-footer:

BUILD FAILED
java.io.FileNotFoundException: /home/myusername/jenkins/jobs/ctascweb/ctpm/src/com/ctasc/ctpm/layout/StdyFooter.java (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
    at java.io.FileWriter.<init>(FileWriter.java:61)
    at org.apache.tools.ant.taskdefs.Echo.execute(Echo.java:67)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
    at org.apache.tools.ant.Main.runBuild(Main.java:758)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Archiving artifacts
Finished: FAILURE

出于某种原因,恶劣空间从/ home / myusername / jenkins / workspace / ctascweb更改为 /家庭/名为myUsername /詹金斯/职位/ ctascweb /工作区。为什么会这样?我唯一做的就是停止并重新启动Tomcat服务器?

3 个答案:

答案 0 :(得分:0)

您是Hudson / Jenkins服务器的管理员吗?

如果最近更新了版本(特别是从Hudson到Jenkins),则用于项目工作空间的路径会有所不同(可以在配置中更改)。您应始终使用${WORKSPACE}变量,而不是直接引用任何路径

另外,这些线条看起来不同,所以不仅仅是Tomcat重启了 [ctascweb] $ cvs -q -z3 update -PdC -r ctascweb-development-3_3_8 -D "Wednesday, November 28, 2012 10:20:13 PM UTC"

[ctascweb] $ cvs -Q -z3 -d :pserver:myusername:pwd@5.0.0.146:/CVS_RESP01 co -P -r ctascweb-development-3_3_8 -d workspace -D "Thursday, November 29, 2012 2:41:16 PM UTC" ctascweb

答案 1 :(得分:0)

从UI中查找作业配置的任何更改。转到高级选项,看看是否有人取消选中您的自定义工作区,就像这样。 我也可以看到你的build_hudson.xml。在构建文件中使用路径的方式可能存在一些问题。

答案 2 :(得分:0)

是的,Jenkins工作区文件夹正在根据我们运行它的方式而改变。我在机器上的Windows XP中看到了这个。

使用java -jar jenkins.war

运行JAR文件时

.jenkins/workspace/<job_name>

当我将其安装为Windows服务时,工作区文件夹更改为.jenkins/<job_name>/workspace