詹金斯未能建立Maven项目

时间:2013-10-02 05:39:31

标签: java maven jenkins

我正在研究一个由jenkins服务器构建的maven项目。工作得很好。但是因为即时通讯使用构建插件(具有完全依赖性),并将javaversion更改为1.6令人不安的

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.278s
[INFO] Finished at: Wed Oct 02 07:32:07 CEST 2013
[INFO] Final Memory: 17M/141M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/workspace/MavenTest/pom.xml to MavenTest/MavenTest/0.0.1-SNAPSHOT/MavenTest-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/workspace/MavenTest/target/MavenTest-0.0.1-SNAPSHOT.jar to MavenTest/MavenTest/0.0.1-SNAPSHOT/MavenTest-0.0.1-SNAPSHOT.jar
[JENKINS] Archiving /var/lib/jenkins/workspace/MavenTest/target/MavenTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar to MavenTest/MavenTest/0.0.1-SNAPSHOT/MavenTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar
channel stopped
FATAL: hudson.maven.MavenBuild.pickArtifactManager()Ljenkins/model/ArtifactManager;
java.lang.NoSuchMethodError: hudson.maven.MavenBuild.pickArtifactManager()Ljenkins/model/ArtifactManager;
    at hudson.maven.MavenBuild$ProxyImpl.performArchiving(MavenBuild.java:455)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:815)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:567)
    at hudson.model.Run.execute(Run.java:1604)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:506)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:246)

这是我的pom:

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>MavenTest</groupId>
    <artifactId>MavenTest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>MavenTest</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>my.maven.example.Main</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
                        <phase>package</phase> <!-- bind to the packaging phase -->
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>

我该如何解决这个问题?

//编辑: 它的jenkins在ubuntu 12.04上,原生安装。

1 个答案:

答案 0 :(得分:1)

乍一看,这似乎是Hudson jar的问题。 你可以试试这个:

  1. 弹出哈德森服务器并清理项目工作区,再试一次。
  2. 如果这不起作用并且您得到相同的错误,请尝试创建一个新的hudson作业,看看它是否有效。
  3. 如果abve 2失败,那么Hudson jar确实存在问题,请更换jar。