0

i have the following lines in pom.xml

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.16</version>
    <type>zip</type>
</dependency>
<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.16</version>
    <classifier>sources</classifier>
</dependency>

then i run

mvn dependency:resolve
mvn eclipse:eclipse

but i cannot find log4j.zip in .classpath, why?

only that source.jar is in .classpath ...

<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/>
4

2 回答 2

1

由于它是一个 zip 文件,因此它被视为资源文件而不是编译时依赖项。应该在运行时和测试类路径中。

于 2012-09-20T18:07:35.957 回答
1

你为什么不删除类型,让 maven 优雅地处理这个?

(仅供参考,在我的项目中,log4j 是 slf4j 的传递 dep,带有打包包)

于 2012-09-21T08:16:56.117 回答