m2eclipse 失踪神器
我正在尝试开始使用 Maven 和 m2eclipse,但我不断收到丢失工件错误:
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>
I am trying to get started with Maven and m2eclipse but I keep getting missing artifact errors:
log4j
is in my local repository. I have m2eclipse set up to use an external installation of Maven although I realize that for dependency resolution it uses the embedded maven. I don't have any custom settings for maven set up, this is a plain install of m2eclipse and maven. I am able to add the dependencies I want through m2eclipse (such as log4j) and it adds them to my pom file. I am at home and not behind a corporate or particularly restrictive firewall.
Can anybody help me figure out what is going on?
Pom file:
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将jar
bundle
更改为change
<type>bundle</type>
to<type>jar</type>