Maven2 +在从站上进行分布式构建。

发布于 2024-12-01 20:43:32 字数 2129 浏览 1 评论 0原文

当我尝试在从站上构建项目时遇到问题。 我有一个 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

我是否需要在从服务器上配置某些内容来处理定义的父服务器对主人? (我不是专家专家......)

I experiencing an issue when tried to build a project on a slave.
I've got a pom.xml with something like that :

<?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>

The build work's very well on the master, however on the slave there is a problem to reach the parent :

[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

Do i need to configure something on the slave to handle with the parent defined on the master ?
( I'm not an maven expert ... )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

み零 2024-12-08 20:43:32

您必须在从站的本地存储库中安装父项目,就像在父项目上使用 mvn install 一样。

You have to install the parent project in the slave's local repo, like with mvn install on the parent project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文