eclipse “m2e 不支持 2.4 之前的 maven-resources-plugin”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7602030/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"maven-resources-plugin prior to 2.4 is not supported by m2e"
提问by Albert
I'm having problems with m2e (Maven plugin into Eclipse IDE).
我在使用 m2e(Eclipse IDE 中的 Maven 插件)时遇到问题。
I see the following error: maven-resources-plugin prior to 2.4 is not supported by m2e. Use maven-resources-plugin version 2.4 or later.
我看到以下错误:m2e 不支持 2.4 之前的 maven-resources-plugin。使用 maven-resources-plugin 2.4 或更高版本。
I have no idea how to resolve this error. I'm pretty sure it is an m2e issue (maybe a setup thing?).
我不知道如何解决这个错误。我很确定这是一个 m2e 问题(也许是设置问题?)。
Background:
背景:
- I'm attempting to build Tika v0.9 http://svn.apache.org/repos/asf/tika/tags/0.9/
- I can build using Maven from command line.
- I can build using Netbeans v7.0.1.
- I am running Maven 3.0.3.
- I am running Eclipse Indigo Service Release 1 (Build id: 20110916-0149)
- I am running m2e v1.0.100.20110804-1717
- 我正在尝试构建 Tika v0.9 http://svn.apache.org/repos/asf/tika/tags/0.9/
- 我可以从命令行使用 Maven 构建。
- 我可以使用 Netbeans v7.0.1 进行构建。
- 我正在运行 Maven 3.0.3。
- 我正在运行 Eclipse Indigo Service Release 1(构建 ID:20110916-0149)
- 我正在运行 m2e v1.0.100.20110804-1717
Thanks for any help.
谢谢你的帮助。
Albert
阿尔伯特
回答by ollins
In the tika.parent project you can find org.apache.apache.6 as parent:
在 tika.parent 项目中,您可以找到 org.apache.apache.6 作为父项:
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>6</version>
<relativePath />
</parent>
And in the pom.xml from org.apache apache you can find:
在 org.apache apache 的 pom.xml 中,您可以找到:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
First simple solution:
第一个简单的解决方案:
add the following into the pom of tika.parent under "build - pluginManagement - plugins" (line 230):
在“build - pluginManagement - plugins”下的 tika.parent 的 pom 中添加以下内容(第 230 行):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
...
And then ask the tika team to use a newer org.apache apache parent pom.
然后要求 tika 团队使用更新的 org.apache apache parent pom。
回答by andrel
How did you import your project into eclipse? (the mvn eclipse:eclipse
goal, or "import maven project" in Eclipse?)
你是如何将你的项目导入到 eclipse 中的?(mvn eclipse:eclipse
目标,或 Eclipse 中的“导入 Maven 项目”?)
Maybe this answer is of relevance: Error in POM.xml
也许这个答案是相关的:POM.xml 中的错误
回答by Rushi Shah
Another solution which worked for me is : 1) Uninstall all the existing Maven plugins from Ecplise. 2) Then install Maven plugin from this location : http://m2eclipse.sonatype.org/sites/m2e-Rushi
另一个对我有用的解决方案是:1) 从 Ecplise 卸载所有现有的 Maven 插件。2) 然后从这个位置安装 Maven 插件:http: //m2eclipse.sonatype.org/sites/m2e -Rushi