Jenkins未能构建Maven项目

时间:2022-09-06 07:29:21

I'm working on a maven project, wich is build by a jenkins-server. worked fine. But since im using the build plugin ( with full dependencies), and changed javaversion to 1.6 its troubling

我正在做一个maven项目,它是由jenkin -server构建的。工作得很好。但是由于我使用的是build插件(完全依赖),并且将javavoidance变为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)

Where this is my pom:

这是我的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>

How can I fix this?

我怎么解决这个问题?

//edit: its jenkins on ubuntu 12.04, native installed.

//编辑:它的jenkins在ubuntu 12.04,本机安装。

1 个解决方案

#1


1  

At first sight it seems to be problem with Hudson jar. You can try following this:

乍一看,这似乎是哈德逊jar的问题。你可以试试以下方法:

  1. Bounce hudson server and clean workspace of project, try again.
  2. 跳出hudson服务器,清理项目工作区,再试一次。
  3. If that doesn't work and you get same error then try creating a new hudson job and see if it works.
  4. 如果这不起作用,并且您得到了相同的错误,那么尝试创建一个新的hudson作业,看看它是否有效。
  5. If abve 2 fails then problem is indeed with Hudson jar, replace the jar.
  6. 如果abve 2失败了,那么问题就出现在Hudson jar中,替换jar。

#1


1  

At first sight it seems to be problem with Hudson jar. You can try following this:

乍一看,这似乎是哈德逊jar的问题。你可以试试以下方法:

  1. Bounce hudson server and clean workspace of project, try again.
  2. 跳出hudson服务器,清理项目工作区,再试一次。
  3. If that doesn't work and you get same error then try creating a new hudson job and see if it works.
  4. 如果这不起作用,并且您得到了相同的错误,那么尝试创建一个新的hudson作业,看看它是否有效。
  5. If abve 2 fails then problem is indeed with Hudson jar, replace the jar.
  6. 如果abve 2失败了,那么问题就出现在Hudson jar中,替换jar。