m2eclipse 说“缺少工件";但我可以从 cmdline 构建! [英] m2eclipse says "Missing artifact" but I can build from cmdline!
问题描述
我第一次尝试使用这个 Sonatype Eclipse 插件来处理一个现有的(巨大的)软件,我可以使用 maven 从命令行构建它.
I'm trying to use this Sonatype Eclipse plugin for the first time to handle an existing (huge) software that I can build with maven form the command line.
我已将插件配置为使用我的 maven 2.2.1 安装而不是内置的 Maven 3.
I have configured the plugin to use my maven 2.2.1 installation instead of the built-in Maven 3.
在 Eclipse 中,我有 25 个项目(通过根 pom.xml 加载),其中 4 个有编译错误;maven 控制台包含很多这样的行:
In Eclipse I have 25 projects (loaded through the root pom.xml) and 4 of them have compilation errors; the maven console contains a lot of lines like this one:
缺少工件 commons-logging:commons-logging:jar:1.0.4:compile
Missing artifact commons-logging:commons-logging:jar:1.0.4:compile
我的存储库中有所有 jar,并且正确定义了 M2_REPO 类路径变量.为什么插件看不到所有的罐子?
I have all the jars in my repository and the M2_REPO classpath variable correctly defined. Why the plugin doesn't see all the jars?
这些项目的 .classpath 文件仅引用MAVEN2_CLASSPATH_CONTAINER",没有 jar 列表.Eclipse 中的 pom.xml 在第一行显示缺少 jar 的错误,但我可以从命令行构建!
The .classpath file of those projects simply references "MAVEN2_CLASSPATH_CONTAINER", there isn't a list of the jars. The pom.xml in Eclipse shows an error on the first line for the missing jars but I can build from the command line!
有什么想法吗?我需要帮助!如果我不解决这个问题,我会尝试迁移到 NetBeans.
Any idea? I need help! I will try to move to NetBeans if I don't solve this problem.
谢谢.
推荐答案
我终于找到了解决方法.这肯定是 m2eclipse 中的一个错误,但是当我在 中的
quartz-1.6.0.jar
旁边添加 quartz-1.6.0.pom
时,问题就消失了.m2
epositoryopensymphonyquartz1.6.0
pom 不存在于 http://repo1.maven.org/maven2/opensymphony/quartz/1.6.0/ 但您可以从 http://jira.opensymphony.com/browse/QUARTZ-482
这是一个奇怪的解决方案,但它也适用于我同事的 PC.
I finally found a workaround. It is surely a bug in m2eclipse, however the problem disappeared when I added quartz-1.6.0.pom
next to quartz-1.6.0.jar
in .m2
epositoryopensymphonyquartz1.6.0
The pom is not present at http://repo1.maven.org/maven2/opensymphony/quartz/1.6.0/ but you can extract it from quartz-1.6.0-bundle.jar
linket at http://jira.opensymphony.com/browse/QUARTZ-482
It's a strange solution but it worked on the PCs of my collegues too.
这篇关于m2eclipse 说“缺少工件";但我可以从 cmdline 构建!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!