我建立了自己的Jenkins并试图建立一个项目来构建它。
当我从Jenkins执行它时,我得到以下日志:
Parsing POMs
[workspace] $ /usr/local/java/jdk1.7.0_40/bin/java -Xmx512m -XX:MaxPermSize=128m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.4.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.32.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.4.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar 53026
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /var/lib/jenkins/jobs/RecipeManager/workspace/pom.xml mvn clean install -Denvironment=ci -X -e
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_40, vendor: Oracle Corporation
Java home: /usr/local/java/jdk1.7.0_40/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.2.0-4-amd64", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Using local repository at /var/lib/jenkins/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /var/lib/jenkins/.m2/repository
Oct 14, 2013 11:09:43 PM org.apache.maven.cli.event.ExecutionEventLogger projectDiscoveryStarted
INFO: Scanning for projects...
[DEBUG] Extension realms for project de.recipeManager:RecipeManager:war:0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: de.recipeManager:RecipeManager:war:0.1-SNAPSHOT
[DEBUG] Tasks: [mvn, clean, install]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO:
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO: ------------------------------------------------------------------------
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO: Building RecipeManager 0.1-SNAPSHOT
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO: ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logResult
INFO: ------------------------------------------------------------------------
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logResult
INFO: BUILD FAILURE
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: ------------------------------------------------------------------------
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Total time: 0.621s
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Finished at: Mon Oct 14 23:09:44 CEST 2013
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Final Memory: 5M/15M
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger sessionEnded
INFO: ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/jobs/RecipeManager/workspace/pom.xml to de.recipeManager/RecipeManager/0.1-SNAPSHOT/RecipeManager-0.1-SNAPSHOT.pom
Sending e-mails to: davejs92@gmail.com
channel stopped
Sending e-mails to: davejs92@gmail.com
Finished: FAILURE
我用-X和-e运行它以查看完整输出但我无法看到它在哪里断开。
如果我添加一个后期构建步骤并在shell中执行以下操作,那么效果很好:
cd /var/lib/jenkins/jobs/RecipeManager/workspace
mvn clean install -Denvironment=ci
我的pom.xml看起来像那样,如果没有Jenkins执行它会很好用:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.recipeManager</groupId>
<artifactId>RecipeManager</artifactId>
<packaging>war</packaging>
<version>0.1-SNAPSHOT</version>
<name>RecipeManager</name>
<url>http://maven.apache.org</url>
<properties>
<spring-version>3.2.3.RELEASE</spring-version>
<jetty-version>8.1.2.v20120308</jetty-version>
<java-version>1.7</java-version>
</properties>
<dependencies>
<!--Spring-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.2.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>0.7.0.RELEASE</version>
</dependency>
<!--Database:-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.2.3.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
</dependency>
<!--JSON Mapping-->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<!--Tests-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-version}</version>
</plugin>
</plugins>
</build>
</project>
有人了解日志吗?
答案 0 :(得分:2)
我建议将项目配置修改为尽可能少的步骤,并确保您知道完全您的“构建”步骤正在调用的目标(尝试“干净安装”启动 - 目前它看起来像是在站点部署中失败了 - 你想要它运行吗?它是否有足够的信息在那里做正确的事情?),让它工作然后添加回来。
另请注意,Jenkins可能会因构建后步骤失败而导致构建失败。例如,如果您选中了“归档工件”,但构建中不包含任何匹配的工件,则即使Maven成功,您的构建仍可能失败。
答案 1 :(得分:-1)
有同样的问题,这是由于maven配置中的“为每个故障模块发送邮件”。我猜maven找不到任何邮件地址发送到,并且在没有告诉原因的情况下失败。