Maven2 +分布式构建在奴隶上。

时间:2011-08-29 18:03:05

标签: maven hudson distributed

尝试在奴隶上构建项目时遇到问题。 我有一个像这样的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!--
    author: xxx
    version: $Id$
-->
<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">

    <parent>
        <groupId>com.xxx</groupId>
        <artifactId>website-parent</artifactId>
        <version>1.0.4</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.xxx</groupId>
    <artifactId>xxx-web</artifactId>
    <name>${pom.artifactId}</name>
    <description>xxx web application</description>
    <packaging>pom</packaging>
    <version>2.1.2-SNAPSHOT</version>

    <properties>
        <package.installdir>/var/goom/www/xxx.com/${package.target}/ROOT</package.installdir>
    </properties>

    <scm>
        <connection>scm:svn:https://xxx/svn/v3/code/websites/com/main/trunk</connection>
        <developerConnection>scm:svn:https://xxx/svn/v3/code/websites/com/main/trunk</developerConnection>
        <url>https://xxx/svn/v3/code/websites/com/main/trunk</url>
    </scm>

</project>

构建工作在主人身上很好,但是在奴隶上有一个问题要到达父母:

[INFO] Unable to find resource 'com.xxx:website-parent:pom:1.0.4' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: com.xxx:xxx-barbershop:pom:2.1.2-SNAPSHOT

Reason: Cannot find parent: com.xxx:website-parent for project: com.xxx:xxx-barbershop:pom:2.1.2-SNAPSHOT for project com.xxx:xxx-barbershop:pom:2.1.2-SNAPSHOT

我是否需要在slave上配置一些东西来处理主服务器上定义的父服务器? (我不是专家......)

1 个答案:

答案 0 :(得分:1)

您必须在slave的本地仓库中安装父项目,就像父项目中的mvn install一样。