未使用pom中定义的Maven插件依赖项存储库 [英] Repository for maven plugin dependency defined in pom is not used

查看:133
本文介绍了未使用pom中定义的Maven插件依赖项存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我切换到我使用的插件的SNAPSHOT版本,并在POM中声明了相应的快照存储库,如下所示:

I switched to a SNAPSHOT version of a plugin I use, and declared the corresponding snapshot repository in the POM like this:

<project>
    <!-- ... -->

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.openjpa</groupId>
                    <artifactId>openjpa-maven-plugin</artifactId>
                    <version>2.3.0-SNAPSHOT</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <repositories>
        <repository>
            <id>apache.snapshots</id>
            <name>Apache Snapshot Repository</name>
            <url>http://repository.apache.org/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
</project>

现在,Maven一直抱怨无法从我们的公司资源库下载插件(该资源库无法在Internet上进行任何镜像)-它只是忽略了POM中定义的资源库.

Now Maven keeps complaining about not being able to download the plugin from our corporate repository (which does not mirror anything on the internet) - it just ignores the repository defined in the POM.

推荐答案

我再次忘记Maven区分repositoriespluginRepositories.以下代码可以正常工作:

I forgot (again) that Maven distinguishes between repositories and pluginRepositories. The following code works fine:

<project>
    <!-- ... -->

    <pluginRepositories>
        <pluginRepository>
            <id>apache.snapshots</id>
            <name>Apache Snapshot Repository</name>
            <url>http://repository.apache.org/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
</project>

这篇关于未使用pom中定义的Maven插件依赖项存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆