繁体   English   中英

Eclipse Luna Gradle插件添加了未引用的依赖项

[英]Eclipse Luna Gradle Plugin adds a dependency that is not referenced

我正在使用Eclipse Luna和Eclipse Luna的Gradle插件(使用来自Pivotal的Gradle IDE Pack 3.6.x)。 我创建了一个具有Gradle支持的简单Java项目。 在我的build.gradle下面

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'artifactory'

buildscript {
  repositories {
    maven { url 'http://dl.bintray.com/jfrog/jfrog-jars' }
    mavenCentral()
  }

  dependencies {
    classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.4')
  }
}

version = '1.0'

repositories {
  maven { url 'http://maven.restlet.com' }
  mavenCentral()
}

dependencies {
  compile group: 'com.cloudit4', name: 'cit4-util-lib', version: '1.0'
  compile group: 'org.restlet.gae', name: 'org.restlet', version: '2.3.2'
  compile group: 'org.restlet.gae', name: 'org.restlet.ext.servlet', version: '2.3.2'
}

// Artifactory...
artifactory {
  contextUrl = 'http://192.168.245.1:8081/artifactory'   //The base Artifactory URL if not overridden by the publisher/resolver
  publish {
    contextUrl = 'http://192.168.245.1:8081/artifactory'   //The base Artifactory URL for the publisher
    //A closure defining publishing information
    repository {
        repoKey = 'libs-release-local'   //The Artifactory repository key to publish to
        username = 'admin'          //The publisher user name
        password = 'mypass'       //The publisher password
    }
  }
  resolve {
    contextUrl = 'http://192.168.245.1:8081/artifactory'   //The base Artifactory URL for the resolver
    repository {
        repoKey = 'repo'  //The Artifactory (preferably virtual) repository key to resolve from
    }
  }
}

您可能会注意到,我正在使用Artifactory托管自己的工件(本地库,cit4-util-lib)。 通常,我会处理使用Google App Engine库的项目,并且很多时候我使用appengine插件将其包含在Gradle中,以进行gradle。 但是,您可能会看到,这次并非如此。 没有任何依赖关系与Google App Engine库具有依赖关系。 但是当我执行Gradle依赖项刷新时,我的依赖项中包含Google App Engine库。 有人看到过这种行为吗? gradle在哪里寻找要包含在项目中的库? 是仅在build.gradle文件中显式设置的依赖项还是更多? 预先感谢您的任何帮助。

问候

马可

当您将依赖项放入依赖项关闭时,gradle将包括所有这些依赖关系的依赖项。 (在https://docs.gradle.org/current/userguide/artifact_dependencies_tutorial.html上查找“传递依赖项”)

看看org.restlet.gae依赖项的pom的旧版本: https ://maven-repository.com/artifact/org.restlet.gae/org.restlet/2.3.1/pom,您可以看到appengine依赖性。 我想这就是它的来历。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM