簡體   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