1

When I run $mvn -q clean install, I see a bunch of [debug] execute contextualize statements printed to the console.

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)

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)

I tried adding the following to my root 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:

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

4

2 回答 2

4

尝试在您的构建设置中添加插件的 groupId :

<build>
  <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
    </plugin>
  </plugins>
</build>
于 2013-09-18T13:40:57.793 回答
1

对于maven-resources-pluginjars、wars 和 ear,默认情况下绑定到生命周期。像您一样将定义添加到您的公司根 POM 应该可以更新使用的版本。检查事项:

  • 继承项目是否指定了包含更改的公司父 POM 的版本?
  • 在运行项目构建之前,您是否mvn clean install在根 POM 上运行过?

如果答案是“是”和“是”,请尝试清理您的本地工件存储库,然后运行mvn clean install​​root,然后再次尝试构建。

于 2013-09-18T13:50:21.150 回答