【问题标题】:Repository for maven plugin dependency defined in pom is not used未使用 pom 中定义的 maven 插件依赖的存储库
【发布时间】:2013-08-14 17:02:34
【问题描述】:

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

<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 一直抱怨无法从我们的公司存储库下载插件(它不会反映互联网上的任何内容) - 它只是忽略了 POM 中定义的存储库。

【问题讨论】:

    标签: maven pom.xml


    【解决方案1】:

    我(再次)忘记了 Maven 区分 repositoriespluginRepositories。以下代码工作正常:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-04
      • 2021-12-05
      • 2016-09-12
      • 1970-01-01
      • 1970-01-01
      • 2022-12-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多