0

我搭建了一个ant项目,成功搭建了一个项目。

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 更改为 /home/myusername/jenkins/jobs/ctascweb/workspace。为什么会这样?我唯一做的就是停止并重新启动 Tomcat 服务器?

4

3 回答 3

0

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

当我使用运行 JAR 文件时 java -jar jenkins.war

这是.jenkins/workspace/<job_name>

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

于 2013-01-04T07:00:22.517 回答
0

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

于 2012-12-03T10:11:19.487 回答
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

于 2012-11-29T15:36:10.530 回答