我正在尝试开始使用 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>
最佳答案
更改<type>bundle</type>
至<type>jar</type>
关于java - m2eclipse 失踪 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6077609/