在maven中使用多个存储库导致下载失败

时间:2016-04-06 09:51:55

标签: maven maven-2 artifactory

在maven中使用多个存储库时我遇到了麻烦。我们使用artifactory作为本地存储库的附加信息。

我有以下maven设置

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
    <server>
        <username></username>
        <password></password>
        <id>central</id>
    </server>
    <server>
        <username></username>
        <password></password>
        <id>snapshots</id>
    </server>
    <server>
        <username></username>
        <password></password>
        <id>Dataproces</id>
    </server>
    <server>
        <username></username>
        <password></password>
        <id>Dataproces-snapshot</id>
    </server>
</servers>
<profiles>
    <profile>
        <id>artifactory</id>
        <repositories>

            <repository>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>snapshots</id>
                <name>libs-snapshot</name>
                <url>https://server/artifactory/libs-snapshot</url>
            </repository>
            <repository>
                <id>Dataproces</id>
                <name>Dataproces-releases</name>
                <url>https://server/artifactory/libs-release-local</url>
            </repository>
<!-----------PROBLEM------------>
            <repository>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>Dataproces-snapshot</id>
                <name>Dataproces-snapshot</name>
                <url>https://server/artifactory/libs-snapshot-local</url>
            </repository>
 <!-----------PROBLEM------------>
            <repository>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>central</id>
                <name>libs-release</name>
                <url>https://server/artifactory/libs-release</url>
            </repository>

        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>central</id>
                <name>plugins-release</name>
                <url>https://server02:8439/artifactory/plugins-release</url>
            </pluginRepository>
            <pluginRepository>
                <snapshots />
                <id>snapshots</id>
                <name>plugins-snapshot</name>
                <url>https://server02:8439/artifactory/pluginssnapshot</url>
            </pluginRepository>
        </pluginRepositories>

        <properties>
            <downloadSources>true</downloadSources>
            <downloadJavadocs>true</downloadJavadocs>
        </properties>
    </profile>
</profiles>

<!-- activeProfiles | List of profiles that are active for all builds. | -->
<activeProfiles>
    <activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>

如果我取消注释“Dataproces-snapshot”它安装得很好,但是当我添加存储库maven突然不会安装,因为缺少pom。错误日志:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building MinSagSilkeborg Controller 0.1
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://server02:8439/artifactory/libs-snapshot-local/dk/kmd/doc2mail/webservice/1/webservice-1.pom
[INFO] Downloading: https://server02:8439/artifactory/libs-snapshot-local/dk/kmd/doc2mail/jcommander/1/jcommander-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.401 s
[INFO] Finished at: 2016-04-06T11:47:03+02:00
[INFO] Final Memory: 15M/741M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MinSagSilkeborg-Controller: Could not resolve dependencies for project dk.dataproces.MinSagSilkeborg:MinSagSilkeborg-Controller:jar:0.1: Failed to collect dependencies at dk.kmd.doc2mail:webservice:jar:1: Failed to read artifact descriptor for dk.kmd.doc2mail:webservice:jar:1: Could not transfer artifact dk.kmd.doc2mail:webservice:pom:1 from/to Dataproces-snapshot (https://server/artifactory/libs-snapshot-local): Failed to transfer https://server/artifactory/libs-snapshot-local/dk/kmd/doc2mail/webservice/1/webservice-1.pom. Error code 409, Conflict -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

当指定的存储库被取消注释时,为什么maven安装没有任何问题? 我知道工件的pom文件丢失了。

0 个答案:

没有答案