1

I set up my own Jenkins and tried to get a project to build on it.

When I execute it from Jenkins i get the following log:

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

I ran it with -X and -e to see the full output but I can't see where it breaks.

And if I add a post-build step and execute the following in the shell it works well:

cd /var/lib/jenkins/jobs/RecipeManager/workspace
mvn clean install -Denvironment=ci

My pom.xml looks like that and works well if it's executed without 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>

Does anyone understand the log?

4

3 回答 3

2

我建议将项目配置缩减到尽可能少的步骤,并确保您确切知道您的“构建”步骤正在调用什么目标(尝试“全新安装”开始 - 目前看起来它在站点中失败了 -部署 - 你想让它运行吗?如果你这样做,它是否有足够的信息来做正确的事情?),让它工作,然后添加回来。

另请注意,Jenkins 可能会因为构建后步骤失败而导致构建失败。例如,如果您选中了“归档工件”,但构建不包含任何匹配的工件,即使 Maven 成功,您的构建仍然可能失败。

于 2013-10-14T22:25:34.897 回答
0

有同样的问题,这是由于在 Maven 配置中“为每个失败的模块发送邮件”。我猜 maven 找不到任何要发送的邮件地址,并且没有说明原因就失败了。

于 2014-07-18T13:42:27.650 回答
0

由于此配置,我遇到了同样的问题:

         post {
                always {
                    publishHTML target: [
                        allowMissing: false,
                        alwaysLinkToLastBuild: false,
                        keepAll: true,
                        reportDir: 'tests/target/results/',
                        reportFiles: 'com.infineon.aurix.tests.html',
                        reportName: 'ADS RCPTT Tests Report'
                    ]
                    junit 'tests/target/surefire-reports/*.xml'
                }
            }

该步骤的reportDir参数publishHTML指向一个不存在的文件夹。日志中没有任何内容,绿色阶段,但整个管道作业失败。

于 2022-01-27T09:14:56.577 回答