When I run $mvn -q clean install
, I see a bunch of [debug] execute contextualize
statements printed to the console.
当我运行$mvn -q clean安装时,我看到一堆[debug]执行打印到控制台的上下文化语句。
After doing some searching, I determined that this is a problem with version 2.5 of the Maven Resources Plugin. This problem has been fixed in version 2.6, but I cant figure out how to get my project to use it. (http://jira.codehaus.org/browse/MRESOURCES-140)
在进行了一些搜索之后,我确定这是Maven资源插件的2.5版本的问题。这个问题在2.6版本中已经解决了,但是我不知道如何让我的项目使用它。(http://jira.codehaus.org/browse/mresources - 140)
None of my projects have this plugin listed in their poms, so I am not sure where Maven is getting it from, maybe it is used in one of the other Apache dependencies or something? (I don't really even understand what this plugin does or how plugins in Maven are used in general)
我的项目都没有在pom中列出这个插件,所以我不确定Maven是从哪里来的,也许它被用于其他的Apache依赖关系中?(我甚至不知道这个插件是做什么的,也不知道Maven中的插件是如何使用的)
I tried adding the following to my root pom:
我尝试在我的根pom中添加以下内容:
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>
However, this doesn't seem to solve the problem. I still see the [debug] execute contextualize
output and when I run $mvn help:effective-pom
, the output still shows:
然而,这似乎并不能解决问题。我仍然看到[debug]执行上下文化输出,当我运行$mvn help: efficient -pom时,输出仍然显示:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
</execution>
</executions>
</plugin>
How can I force Maven to use the newer version of this plugin so that I can suppress the annoying [debug] execute contextualize
outputs?
如何强制Maven使用这个插件的新版本,以便能够抑制烦人的[debug]执行上下文化输出?
2 个解决方案
#1
1
The maven-resources-plugin
is bound to the lifecycle by default for jars, wars, & ears. Adding a definition to your corporate root POM as you did should work to update the version used. Things to check:
maven-resources-plugin默认绑定到jar、war和ear的生命周期。为您的企业根目录添加一个定义,就像您应该做的一样,以更新所使用的版本。检查:
- Is the inheriting project specifying the version of the corporate parent POM that includes the change?
- 继承项目是否指定包含更改的公司父POM的版本?
- Did you run
mvn clean install
on the root POM prior to running the project build? - 在运行项目构建之前,您是否在根POM上运行mvn clean安装?
If the answer is "yes" and "yes", try cleaning out your local artifact repo, then run mvn clean install
for the root, and try the build again.
如果答案是“是”和“是”,请尝试清理您的本地工件repo,然后为根运行mvn clean安装,然后再次尝试构建。
#2
0
Try do add the groupId of the plugin in your build settings :
试着在你的构建设置中添加插件的类群:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>
#1
1
The maven-resources-plugin
is bound to the lifecycle by default for jars, wars, & ears. Adding a definition to your corporate root POM as you did should work to update the version used. Things to check:
maven-resources-plugin默认绑定到jar、war和ear的生命周期。为您的企业根目录添加一个定义,就像您应该做的一样,以更新所使用的版本。检查:
- Is the inheriting project specifying the version of the corporate parent POM that includes the change?
- 继承项目是否指定包含更改的公司父POM的版本?
- Did you run
mvn clean install
on the root POM prior to running the project build? - 在运行项目构建之前,您是否在根POM上运行mvn clean安装?
If the answer is "yes" and "yes", try cleaning out your local artifact repo, then run mvn clean install
for the root, and try the build again.
如果答案是“是”和“是”,请尝试清理您的本地工件repo,然后为根运行mvn clean安装,然后再次尝试构建。
#2
0
Try do add the groupId of the plugin in your build settings :
试着在你的构建设置中添加插件的类群:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>