maven:仓库中的插件,但mvn找不到

时间:2018-11-08 10:55:33

标签: maven nexus

很奇怪的事情:

我们使用一个关系存储库,当我声明

    <dependency>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>wls-maven-plugin</artifactId>
        <version>12.1.3.0</version>
    </dependency>

它已下载到存储库中

Downloading: https://my.secret.domain/nexus/content/groups/public-thirdparty/com/oracle/weblogic/wls-maven-plugin/12.1.3.0/wls-maven-plugin-12.1.3.0.pom
Downloaded: https://my.secret.domain/nexus/content/groups/public-thirdparty/com/oracle/weblogic/wls-maven-plugin/12.1.3.0/wls-maven-plugin-12.1.3.0.pom (474 B at 1.2 KB/sec)
Downloading: https://my.secret.domain/nexus/content/groups/public-thirdparty/com/oracle/weblogic/wls-maven-plugin/12.1.3.0/wls-maven-plugin-12.1.3.0.jar
Downloaded: https://my.secret.domain/nexus/content/groups/public-thirdparty/com/oracle/weblogic/wls-maven-plugin/12.1.3.0/wls-maven-plugin-12.1.3.0.jar (146 KB at 557.8 KB/sec)

(实际上存在),但是当我尝试将其用作插件时:

        <plugin>
            <groupId>com.oracle.weblogic</groupId>
            <artifactId>wls-maven-plugin</artifactId>
            <version>12.1.3.0</version>
            <executions>
                <execution>
                    <id>wls-appc</id>
                    <phase>package</phase>
                    <goals>
                        <goal>appc</goal>
                    </goals>
                    <configuration>
                        <artifactLocation>com.oracle.weblogic:wls-dev:zip:12.1.3.0</artifactLocation>
                        <middlewareHome>${env.BEA_HOME}</middlewareHome>
                        <classpath>${util.classpath}</classpath>
                    </configuration>
                </execution>
            </executions>
        </plugin>

突然找不到了:

[ERROR] Plugin com.oracle.weblogic:wls-maven-plugin:12.1.3.0 or one of its dependencies could not be resolved: Failure to find com.oracle.weblogic:wls-maven-plugin:jar:12.1.3.0 in https://my.secret.domain/nexus/content/repositories/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]

注意:与未找到它的仓库相比,它是从不同的仓库下载它的:

https://my.secret.domain/nexus/content/groups/public-thirdparty

vs

https://my.secret.domain/nexus/content/repositories/public

但是它在本地...

有人可以帮忙吗?

我真的对这个感到困惑...

如果需要其他信息,我会很乐意提供...

1 个答案:

答案 0 :(得分:0)

显然这是问题所在

<mirror>
    <id>nexus</id>
    <mirrorOf>external:*,!digit</mirrorOf>
    <url>https://my.secret.domain/nexus/content/repositories/public</url>
</mirror>

<mirror>
    <id>digit</id>
    <mirrorOf>digit</mirrorOf>
    <url>https://my.secret.domain/nexus/content/groups/public-thirdparty/</url>
</mirror>  

在settings.xml中...

如果您指向“组”->“ https://my.secret.domain/nexus/content/ / public-thirdparty /”(在我们的配置中),则会下载插件,但会尝试对其进行验证仅包含存储库(因此https://my.secret.domain/nexus/content/ 存储库 /公共),却找不到它...

-X在此方面确实很有帮助...