简体   繁体   English

为什么Maven不在Eclipse中将某些jar添加到.classpath文件中?

[英]Why are some jars not added to .classpath file in eclipse by maven?

I would like to add the following dependency to a maven (I'm not using the m2e plugin). 我想将以下依赖项添加到Maven中(我不使用m2e插件)。

<dependency>
    <groupId>uk.com.robust-it</groupId>
    <artifactId>cloning</artifactId>
    <version>1.9.0</version>
</dependency>

The problem is that the jar simply is not added to the .classpath file in eclipse when I execute mvn eclipse:clean eclipse:eclipse . 问题是当我执行mvn eclipse:clean eclipse:eclipse时,jar根本不会添加到eclipse中的.classpath文件中。 It works fine for this dependency. 对于这种依赖关系,它工作正常。

<dependency>
    <groupId>org.jdom</groupId>
    <artifactId>jdom2</artifactId>
    <version>2.0.5</version>
</dependency>

Maven does donwload cloning the dependency. Maven不会下载克隆依赖项。 The correct .jar file is in ~/.m2/repositories . 正确的.jar文件在~/.m2/repositories I also tried mvn eclipse:configure-workspace before executing mvn eclipse:clean eclipse:eclipse . 在执行mvn eclipse:clean eclipse:eclipse之前,我还尝试了mvn eclipse:configure-workspace Didn't help either. 也没有帮助。 Running mvn clean compile test integration-test works fine, even if I add imports to classes in cloning. 即使我在克隆中将导入添加到类中,运行mvn clean compile test integration-test可以正常工作。

Any help is greatly appreciated! 任何帮助是极大的赞赏!

Try a 尝试一个

 mvn help:effective-pom

to see if the scope is provided 看看是否providedscope

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Maven:将第三方jar的导出jar添加到manifest中的classpath - Maven: Export jar with 3rd-party jars added to classpath in manifest 打印到Eclipse Maven项目中使用过的jar文件 - Print to file used jars in an eclipse maven project 是否要将Tomcat jar添加到类路径? - Are Tomcat jars meant to be added to the classpath? Eclipse 运行配置:如何添加已添加到 Classpath 的项目的 Maven 依赖项 - Eclipse Run Configurations: how to add Maven dependencies of projects added to Classpath 尽管我将jar文件添加到classpath(Eclipse),为什么Connection to SQLite会失败? - Why does Connection to SQLite fail although I added jar file to classpath (Eclipse)? 如何添加非行罐子到类路径? - How to add non-maven jars to classpath? Maven不会将jar复制到classpath(使用STS) - Maven doesn't copy jars to classpath (with STS) 将 jars 从 Maven 项目导入到项目类路径 - Import jars to project classpath from a maven project 为什么类通过自定义类路径容器添加到jar中而不能用于代码完成? - Why are classes kept in jars added via custom classpath container not available for code completion? 为什么以及何时 Eclipse 将 Maven 依赖项放在 CLASSPATH 中而不是 MODULEPATH 中? - Why and when is Eclipse putting Maven dependencies in the CLASSPATH and not in the MODULEPATH?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM