2011-05-20 62 views
2

我想开始使用Maven和m2eclipse的,但我不断收到缺少神器错误:m2eclipse的缺少神器

enter image description here

log4j是在我的本地库。我将m2eclipse设置为使用Maven的外部安装,尽管我意识到为了解决依赖关系,它使用嵌入式Maven。我没有为maven设置任何自定义设置,这是m2eclipse和maven的简单安装。我可以通过m2eclipse添加我想要的依赖项(比如log4j),并将它添加到我的pom文件中。我在家,不在公司或特别限制性的防火墙之后。

有人能帮我弄清楚发生了什么事吗?

POM文件:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.xonatype.mavenbook.ch04</groupId> 
    <artifactId>simple-weather</artifactId> 
    <version>1.0</version> 
    <name>Simple Weather</name> 

    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.8.2</version> 
     <type>jar</type> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <version>1.2.16</version> 
     <type>bundle</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>dom4j</groupId> 
     <artifactId>dom4j</artifactId> 
     <version>20040902.021138</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>jaxen</groupId> 
     <artifactId>jaxen</artifactId> 
     <version>1.1.1</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>velocity</groupId> 
     <artifactId>velocity</artifactId> 
     <version>1.5</version> 
     <type>pom</type> 
     <scope>compile</scope> 
    </dependency> 
    </dependencies> 
    <properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 
</project> 

回答

5

变化<type>bundle</type><type>jar</type>

+0

我不能相信工作。我也发现了这一点,但是图形用户界面却把它变成了jar。在pom.xml文件中更改为jar后,它可以工作。 – KPthunder 2011-05-21 01:13:53

+0

捆绑和jar之间的区别是什么 - 如何选择一个或另一个? – Matt 2011-10-04 00:50:00

相关问题