为什么Maven不承认父母使用Jenkins的pom的定制回购?

为什么Maven不承认父母使用Jenkins的pom的定制回购?,maven,jenkins,artifactory,Maven,Jenkins,Artifactory,我有以下的父母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.

我有以下的父母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>...</groupId>
    <artifactId>core</artifactId>
    <packaging>pom</packaging>
    <version>0.0.12-SNAPSHOT</version>
    ...
</project>
它不使用自定义回购,而是使用默认回购。我错过了什么?是否需要运行一些预步骤来配置父级回购

Settings.xml


看起来好像某个地方的镜子设置不正确,我该如何移除它?我仔细检查了我的代码,没有在任何地方看到镜像。

问题似乎是安装在Jenkins服务器上settings.xml中的默认镜像或它正在使用的任何东西。关键是maven上的-X选项,这显示了镜像映射。所以为了解决这个问题,我将其改写为删除自定义回购

<mirrors>
    <mirror>
        <!--This sends everything else to /jpmc-public -->
        <id>main</id>
        <mirrorOf>*,!CUSTOM</mirrorOf>
        <url>... main url</url>
    </mirror>
</mirrors>

我只是将它添加到remote settings.xml中,因为它会破坏本地的东西。但是,这似乎解决了问题。

问题似乎是安装在Jenkins服务器上settings.xml中的默认镜像或它正在使用的任何东西。关键是maven上的-X选项,这显示了镜像映射。所以为了解决这个问题,我将其改写为删除自定义回购

<mirrors>
    <mirror>
        <!--This sends everything else to /jpmc-public -->
        <id>main</id>
        <mirrorOf>*,!CUSTOM</mirrorOf>
        <url>... main url</url>
    </mirror>
</mirrors>

我只是将它添加到remote settings.xml中,因为它会破坏本地的东西。但是,这似乎解决了问题。

您能提供您正在使用的settings.xml吗?此外,settings.xml是否存储在您正在构建的pom的存储库中?如果不是,您应该为itAdded使用绝对路径,并且它存储在项目中,这似乎同样适用于我可以在具有相同配置但没有父级的其他项目上部署的其他步骤。我还使用Jenkins脚本打印出文件位置实际上存在于Jenkins working Directory中,看起来应该可以工作。有什么有用的输出我可以看一下吗?没有,除了它没有尝试之外。我不知道最好的猜测是Jenkins的配置有问题,但其他项目没有问题。这是第一个有父项目的项目。您能提供您正在使用的settings.xml吗?此外,settings.xml是否存储在您正在构建的pom的存储库中?如果不是,您应该为itAdded使用绝对路径,并且它存储在项目中,这似乎同样适用于我可以在具有相同配置但没有父级的其他项目上部署的其他步骤。我还使用Jenkins脚本打印出文件位置实际上存在于Jenkins working Directory中,看起来应该可以工作。有什么有用的输出我可以看一下吗?没有,除了它没有尝试之外。我迷路了最好的猜测是Jenkins的配置有问题,但其他项目没有问题这是第一个有家长的项目。
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
    <servers>
        <server>
            <id>CUSTOM</id>
            <username>...</username>
            <password>...</password>
        </server>
        <server>
            <id>CUSTOM-SNAPSHOT</id>
            <username>...</username>
            <password>...</password>
        </server>
    </servers>
    <profiles>
        <profile>
            <id>mine</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <pluginRepositories>
                ...
            </pluginRepositories>
            <repositories>
                <repository>
                    <id>CUSTOM-SNAPSHOT</id>
                    <url>...</url>
                    <releases><enabled>false</enabled></releases>
                    <snapshots><enabled>true</enabled></snapshots>
                </repository>
                <repository>
                    <id>CUSTOM</id>
                    <url>...</url>
                    <releases><enabled>true</enabled></releases>
                    <snapshots><enabled>false</enabled></snapshots>
                </repository>
                <repository>
                    <id>main</id>
                    <url>...</url>
                    <releases><enabled>true</enabled></releases>
                    <snapshots><enabled>false</enabled></snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles>
        <!-- make the profile active all the time -->
        <activeProfile>mine</activeProfile>
    </activeProfiles>
</settings>
[DEBUG] Using mirror main (...main url) for custom (... custom url).
<mirrors>
    <mirror>
        <!--This sends everything else to /jpmc-public -->
        <id>main</id>
        <mirrorOf>*,!CUSTOM</mirrorOf>
        <url>... main url</url>
    </mirror>
</mirrors>