【问题标题】:m2eclipse Missing Artifactm2eclipse 缺失的神器
【发布时间】:2011-05-20 21:08:05
【问题描述】:

我正在尝试开始使用 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>

【问题讨论】:

    标签: java eclipse m2eclipse maven-3


    【解决方案1】:

    &lt;type&gt;bundle&lt;/type&gt; 更改为&lt;type&gt;jar&lt;/type&gt;

    【讨论】:

    • 我不敢相信这有效。我也抓住了这一点,但 GUI 很想把它改成 jar。在 pom.xml 文件中更改为 jar 后,它可以工作了。
    • bundle 和 jar 之间有什么区别 - 一个人怎么知道选择一个或另一个?
    猜你喜欢
    • 2013-01-21
    • 2013-02-01
    • 2013-05-12
    • 2014-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-15
    • 2011-07-13
    相关资源
    最近更新 更多