我有个你们都知道怎么解决的问题。我将我的一个项目的新构建推到我的Sonatype Nexus实例中。然后,我更新了另一个项目的依赖项,以使用新的构建版本。刷新项目之后,Eclipse抱怨了下面的问题。
"Illegal entry in Gradle Dependencies: c:/Users/..."我使用"gradle build“在命令行上构建了这个项目,它成功地下载了新的工件依赖项。我再次访问了我的Eclipse,并使用STS Gradle -> Refresh All刷新了它,同样的问题。在上网后,我发现一些帖子说要尝试重新导入这个项目,但这也不起作用。经过几次刷新和重新启动,我仍然没有得到任何地方。接下来,我使用了"gradle cleanEclipse eclipse“,这个问题在Eclipse中得到了解决,但现在它不承认它是一个Gradle项目。
如果有人知道允许导入新的依赖关系版本的修复,而不需要手动生成Eclipse文件,请让我和SO社区的其他成员知道。
编辑:完全错误如下:
Project 'Spirit' is missing required library: 'C:\Users\Zixradoom\Documents\bin\eclipse\eclipse\unresolved dependency - org.apache.logging.log4j log4j-core 2.0.2'
我删除了gradle缓存dir,然后在恢复缓存的命令行上重新构建了这个项目,但是现在Eclipse声称它不能再看到任何libs。我已经刷新了项目,这也没有更新他们。
级构建狙击手:
repositories {
maven {
credentials {
username mavenUser
password mavenPassword
}
url "https://www.example.com/nexus/content/groups/public"
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
compile group: 'com.s2d', name: 'Cognition', version: '1.0.0.5'
}构建在命令行上:
Zixradoom@ZIXRADOOMSLAPTOP /C/Users/Zixradoom/Documents/localGit/Spirit (master)
$ gradle build
:compileJava
Download https://www.example.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-api/2.0.2/log4j-api-2.0.2.pom
Download https://www.example.com/nexus/content/groups/public/org/apache/logging/log4j/log4j/2.0.2/log4j-2.0.2.pom
Download https://www.example.com/nexus/content/groups/public/org/apache/apache/9/apache-9.pom
Download https://www.example.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-core/2.0.2/log4j-core-2.0.2.pom
Download https://www.example.com/nexus/content/groups/public/com/s2d/Cognition/1.0.0.5/Cognition-1.0.0.5.pom
Download https://www.example.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-api/2.0.2/log4j-api-2.0.2.jar
Download https://www.example.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-core/2.0.2/log4j-core-2.0.2.jar
Download https://www.example.com/nexus/content/groups/public/com/s2d/Cognition/1.0.0.5/Cognition-1.0.0.5.jar
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build
BUILD SUCCESSFUL
Total time: 16.38 secs发布于 2015-04-17 06:39:44
我通过在我的build.gradle中添加以下内容解决了这个问题
repositories {
mavenLocal()
maven { url "http://localrepo:8081/artifactory/libs-release" }
}https://stackoverflow.com/questions/26748915
复制相似问题