Hudson:多模块maven项目的构建失败,然后立即再次成功

时间:2011-09-27 12:57:27

标签: maven continuous-integration hudson multi-module

我有一个多模块项目,其中顶级项目既作为单个模块的父项,也作为声明模块的项目。只有这个顶级项目在Hudson中配置(包括自动SVN签出)。简化的布局如下:

ProjectRoot\
|
+---kernel\
|   |
|   +---pom.xml [ArtifactId=MyProject_kernel parent=MyProject]
|
+---model_foo\
|   |
|   +---pom.xml [ArtifactId=MyProject_model_foo, parent=MyProject]
|
+---pom.xml [ArtifactId=MyProject, parent=none]

此外,model_foo依赖于kernel

现在,Hudson会自动发现kernelmodel_foo个子项目,它通常可以很好地构建一切。

但是,每次我进行重大更改时,例如在kernel中创建新类并在model_foo中使用它,我会得到model_foo的失败构建,然后是成功的。邮件通知标题为

  • Build failed in Hudson: MyProject » MyProject Model Foo #1545
  • Hudson build is back to normal : MyProject » MyProject Model Foo #1546

为什么?我怀疑这可能与MyProject pom.xml是多模块项目及其模块的父项这一事实有关,但在更改之前我想知道它是否真的会有所帮助。

我使用的是Hudson 2.1.0。

更新

这是web模块失败构建的日志(在上图中等于model_foo)。 MyProject根项目的构建具有相同的构建号,并且成功。

我删除了实际的编译器错误,这与新引入的类缺失完全相同。

Started by upstream project "MyProject" build number 1545
Found mavenVersion 2.0.9 from file jar:file:/home/builder/opt/apache-maven-2.0.9/lib/maven-2.0.9-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
$ /home/builder/opt/jdk1.5.0_22//bin/java -Xmx1024m -Xms512m -cp /home/builder/var/hudson/plugins/maven-plugin/WEB-INF/lib/maven-agent-2.1.0.jar:/home/builder/opt/apache-maven-2.0.9/boot/classworlds-1.1.jar hudson.maven.agent.Main /home/builder/opt/apache-maven-2.0.9 /home/builder/opt/apache-tomcat-6.0.24/webapps/hudson/WEB-INF/lib/hudson-remoting-2.1.0.jar /home/builder/var/hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-2.1.0.jar 48555
<===[HUDSON REMOTING CAPACITY]===>   channel started
Executing Maven:  -N -B -f <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/pom.xml> clean deploy -Dworkspace.path=/home/builder/var/hudson/jobs/MyProject/workspace/ -Droot.project.name=MyRoot -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building MyProject
[INFO]    task-segment: [clean, deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/target>
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 945 source files to <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/target/classes>
[HUDSON] Archiving <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/pom.xml> to /home/builder/var/hudson/jobs/MyProject/modules/com.mycompany.myproject$web/builds/2011-09-27_13-32-33/archive/com.mycompany.myproject/web/1.1-SNAPSHOT/pom.xml
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

{{{compiler failure here}}}


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
    {{{stacktrace omitted}}}
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
    {{{stacktrace omitted}}}
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 7 seconds
[INFO] Finished at: Tue Sep 27 13:33:42 CEST 2011 [INFO] Final Memory: 53M/508M
[INFO] ------------------------------------------------------------------------

0 个答案:

没有答案