哈德森构建失败:非解析父POM [英] Hudson build fail: Non-resolvable parent POM

查看:366
本文介绍了哈德森构建失败:非解析父POM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用我的项目与哈德森的工作,最近我不得不将它移动到新的服务器。

I used to work with Hudson on my project, and lately I had to move it to a new server.

我配置它用它是完全相同的方式(适用于所有我可以告诉),但是当我尝试推出一个版本,它失败,我得到了以下错误:

I configured it the exact same way it use to be (for all I can tell) but when I try to launch a build, it fails and I get the following error:

Démarré par l'utilisateur anonymous
Checking out http://[...]/trunk/MyProject/ear
A         .classpath
A         .project
A         target
AU        target/ear-1.0-SNAPSHOT.ear
A         target/application.xml
A         target/ear-1.0-SNAPSHOT
A         target/ear-1.0-SNAPSHOT/META-INF
A         target/ear-1.0-SNAPSHOT/META-INF/application.xml
AU        target/ear-1.0-SNAPSHOT/web-1.0-SNAPSHOT.war
AU        target/ear-1.0-SNAPSHOT/business-1.0-SNAPSHOT.jar
A         pom.xml
A         .settings
A         .settings/org.eclipse.jdt.core.prefs
A         .settings/org.maven.ide.eclipse.prefs
At revision 136
no change for http://[...]/trunk/MyProject/ear since the previous build
Found mavenVersion 3.0.2 from file jar:file:/usr/share/maven/apache-maven-3.0.2/lib/maven-core-3.0.2.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
Parsing POMs
ERROR: Echec à la lecture des POMs
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM: Could not find artifact com.rha:MyProject:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 9, column 10

    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:325)
    at hudson.maven.MavenEmbedder.buildProjects(MavenEmbedder.java:360)
    at hudson.maven.MavenEmbedder.readProjects(MavenEmbedder.java:330)
    at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1148)
    at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:991)
    at hudson.FilePath.act(FilePath.java:756)
    at hudson.FilePath.act(FilePath.java:738)
    at hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:698)
    at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:531)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420)
    at hudson.model.Run.run(Run.java:1362)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:405)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)
Finished: FAILURE

当我到哈德逊工作区的pom.xml文件看起来是这样的:

The pom.xml file when I got to Hudson "workspace" looks like this:


[...]

[...]

    <parent>
        <groupId>com.rha</groupId>
        <artifactId>MyProject</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

[...]

    <dependencies>
        <dependency>
            <groupId>com.rha</groupId>
            <artifactId>business</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>ejb</type>
        </dependency>
        <dependency>
            <groupId>com.rha</groupId>
            <artifactId>web</artifactId>
            <version>1.0-SNAPSHOT</version>
            <type>war</type>
        </dependency>
    </dependencies>

</project>

其实我忘了一些重要的信息:

Actually I forgot some important informations:

我的项目分为3个部分:

My project is divided into 3 parts:

业务(打包成的.jar)
幅(打包成一个.war)
耳(打包的.war和.jar成的.ear)

business (packaged into .jar) web (packaged into a .war) ear (packaged the .war and .jar into a .ear)

我使用的颠覆,在我的主干文件夹中我得到了包括MyProject的文件夹:

I'm using Subversion, and under my "trunk" folder I got a "MyProject" folder including:

.project
.settings/
business/
ear/
pom.xml
src/
web/

发生的事情是:

在我的哈德森作业配置,我充满了SVN场库网址有:

in my Hudson job configuration, I filled the SVN field "repository URL" with:

HTTP:// [...] /主干/ MyProject的/耳

http://[...]/trunk/MyProject/ear

和这里是从MyProject的文件夹的pom.xml

and here is the "pom.xml" from "MyProject" folder:

<?xml version="1.0" encoding="UTF-8"?>
<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 

[...]
    <modules>
        <module>business</module>
        <module>web</module>
        <module>ear</module>
    </modules>
[...]

因此​​父的pom.xml实际上是位于在我的SVN库../pom.xml,躯干/ MyFolder文件下。

so the parent "pom.xml" is actually located at "../pom.xml" on my SVN repository, under "trunk/MyFolder".

但哈德森不能看到它由于某种原因(但就像我说的,它曾经在previous服务器上运行)。

But Hudson can't see it for some reason (but like I said, it used to work on the previous server).

任何线索?

[/编辑]

我想这是一个新手的错误,我在Maven的总初学者,但我就是不明白,为什么它不工作了...

I guess this is a rookie mistake, I'm a total beginner on Maven, but I just can't figure out why it's not working anymore ...

任何帮助将大大AP preciated!

Any help will be greatly appreciated !

萨科

推荐答案

relativePath (即)的默认值到 ../的pom.xml 。它看起来是不是有present。这样下载的Maven依赖于它,你可以将它设置为空值。

relativePath (of the parent) defaults to ../pom.xml. It looks like it is not present in there. You could set it to an empty value so that maven downloads it as a dependency.

 <relativePath/> 

<一个href=\"http://maven.40175.n5.nabble.com/mvn-3-parent-relativePath-problem-but-no-relativePath-element-td3278463.html\">This链接讨论这个问题。

哈德森只看到耳夹内源$ C ​​$ C。尽管父POM是SVN present,它不是提供给哈德森。缺少父POM在Maven的2,但strict在Maven的3。

Hudson only sees the source code inside ear folder. Though the parent pom is present in SVN, it is not available to Hudson. Missing parent pom was aa warning in Maven 2 but strict in Maven 3.

有两种方法来解决这个问题。

There are two ways to solve this.

一是指定哈德森,网址的http:// [...] /主干/ MyProject的/ 。然后,您可以选择建立所有的模块或仍选择独自打造的的pom.xml 穗项目。

One is to specify to hudson, the url http://[...]/trunk/MyProject/. You can then chose to build all the modules or still choose to build the pom.xml of ear project alone.

另外就是哈得逊系统上手动运行 MVN安装,这样父POM被部署一次,此后哈德森使用。但是,这不会得到,如果父POM随后被更改更新。

The other is to manually run mvn install on the hudson system so that the parent pom gets deployed once and thereafter used by hudson. However, this will not get updated if parent pom is subsequently changed.

这篇关于哈德森构建失败:非解析父POM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆