由于 pom.xml 中存在错误,无法使用 Maven 运行构建
我正在尝试在 Eclipse 中构建一个新的 Maven 项目。 在我的 pom.xml 中,我收到一个错误,指出
在这一行找到多个注释: - 缺少工件 maven-plugins:maven-findbugs-plugin:plugin:1.3.1 - 缺少工件 maven-plugins:maven-cobertura-plugin:plugin:1.3
这是我在 pom.xml 中“cobertura”的依赖代码:
<dependency>
<groupId>maven-plugins</groupId>
<artifactId>maven-cobertura-plugin</artifactId>
<version>1.3</version>
<type>plugin</type>
</dependency>
我尝试添加存储库,如下所示,但仍然不起作用。
<repositories>
<repository>
<id>repository.maven-plugins.sourceforge.net</id>
<name>maven plug-in repository</name>
<url>http://maven-plugins.sourceforge.net/repository</url>
</repository>
<repository>
<id>repository.ibiblio.org-maven</id>
<name>ibiblio repository</name>
<url>http://www.ibiblio.org/maven</url>
</repository>
</repositories>
此处链接到 Maven 插件
http://maven-plugins.sourceforge.net/maven -findbugs-plugin/announcements/announcement-1.3.1.txt
http://maven-plugins.sourceforge.net/maven-cobertura -plugin/announcements/announcement-1.3.txt
我不想手动安装这些插件。我需要通过在 pom.xml 中声明它们来自动安装它们
请帮忙。
谢谢
I am trying to build a new Maven project in Eclipse.
In my pom.xml, I got an error which says
Multiple annotations found at this line:
- Missing artifact maven-plugins:maven-findbugs-plugin:plugin:1.3.1
- Missing artifact maven-plugins:maven-cobertura-plugin:plugin:1.3
Here is my dependency code for "cobertura" in pom.xml:
<dependency>
<groupId>maven-plugins</groupId>
<artifactId>maven-cobertura-plugin</artifactId>
<version>1.3</version>
<type>plugin</type>
</dependency>
I tried adding repositories as below, but still didn't work.
<repositories>
<repository>
<id>repository.maven-plugins.sourceforge.net</id>
<name>maven plug-in repository</name>
<url>http://maven-plugins.sourceforge.net/repository</url>
</repository>
<repository>
<id>repository.ibiblio.org-maven</id>
<name>ibiblio repository</name>
<url>http://www.ibiblio.org/maven</url>
</repository>
</repositories>
Links to Maven plugins here
http://maven-plugins.sourceforge.net/maven-findbugs-plugin/announcements/announcement-1.3.1.txt
http://maven-plugins.sourceforge.net/maven-cobertura-plugin/announcements/announcement-1.3.txt
I don't want to do Manual installation for these plugins. I need to install them automatically by declaring them in pom.xml
Please help.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
作为一个相关问题,我发现例如 jaxen-1.1.3 引用了上述 maven1 工件。 Eclipse 中的 POM 编辑器向您显示依赖关系层次结构。它添加了以下内容来选择显式排除:
As a related issue, I found that e.g. jaxen-1.1.3 references the above maven1 artifacts. The POM editor in Eclipse shows you the dependency hierarchy. It added the following for selecting explicit excludes:
这些是 maven 1 插件,不适用于 maven 2。这些是插件的当前版本。
您可以在其中定义插件
标签而不是
标签。另请注意下面这些插件的groupId
和artifactId
的变化...These are maven 1 plugins and will not work with maven 2. These are the current versions of the plugins.
You would define plugins within
<plugins>
tag and not<dependencies>
tag. Also note the change ingroupId
andartifactId
for these plugins below...