【发布时间】:2014-09-29 02:36:07
【问题描述】:
我想使用 maven-install-plugin 将几个 jars 安装到我的本地 maven repo。我的 maven 3.2.1 安装使用这个插件的 2.4 版本,它需要很多参数来指定。如http://maven.apache.org/plugins/maven-install-plugin/usage.html 所述,我想使用需要较少参数的2.5 版。如果我从具有以下 pom.xml 文件的文件夹中运行 mvn install:install-file,则它使用 2.5 版:
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
否则,它仍然使用旧插件。如何强制 Maven 使用 maven-install-plugin 2.5 版(如果我从任何文件夹运行 install-file)?
附: How to install third party source and javadoc JARs? 不包含答案。
【问题讨论】:
-
你能提供给我们你的完整 pom 吗?
-
我在我的帖子中添加了来自 pom.xml 的更多 xml 节点。其他 pom 设置是通用的。
-
在命令
mvn groupId:artifactId:version:goal中使用版本。 -
您必须指定不在
<pluginManagement>标签中的插件。相反,它应该在您的<build>标签中。 -
运行
mvn org.apache.maven.plugins:maven-install-plugin:2.5:install-file。
标签: maven maven-install-plugin