gpt4 book ai didi

eclipse - Maven 2 eclipse

转载 作者:行者123 更新时间:2023-12-02 07:47:25 24 4
gpt4 key购买 nike

使用maven2eclipse插件,问题是零文档。当我在eclipse的“启用依赖关系管理”中右键单击该项目时,它给了我一个选择,但是除了以下控制台输出外,它还给了我一个相当稀疏的POM.xml:

04/05/11 14:57:54 BST: Generating sources /BenCode/pom.xml
04/05/11 14:57:54 BST: Build error for /BenCode/pom.xml; org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3
04/05/11 14:57:54 BST: Failed to determine compiler source setting, assuming default
04/05/11 14:57:54 BST: Failed to determine compiler target setting, assuming default
04/05/11 14:57:54 BST: Failed to determine compiler source setting, assuming default
04/05/11 14:57:54 BST: Failed to determine compiler target setting, assuming default
04/05/11 14:57:54 BST: Failed to determine compiler test inclusions, assuming defaults
04/05/11 14:57:54 BST: Failed to determine compiler test exclusions, assuming defaults
04/05/11 14:57:54 BST: Failed to determine compiler inclusions, assuming defaults
04/05/11 14:57:54 BST: Failed to determine compiler exclusions, assuming defaults
04/05/11 14:57:54 BST: Refreshing [/BenCode/pom.xml]

在尝试制定解决方案之前没有使用过Maven就是一个难题。我的印象是,maven应该使用该信息来扫描类路径依赖项来管理项目,但是没有运气:(

最佳答案

Maven将仅管理POM中指定的依赖关系(以及任何传递性依赖关系(即,您直接定义的依赖关系的依赖关系))。
例如。下面将在测试范围内将JUnit添加为依赖项

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<!-- ... -->
</dependencies>

如果右键单击pom.xml,则可以选择Maven->添加依赖项-这将搜索默认存储库。

另请阅读 Introduction to the Dependency Mechanism

关于eclipse - Maven 2 eclipse ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5885235/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com