如何记录gradle编译中使用的jar文件

时间:2012-06-22 17:01:59

标签: gradle

我尝试记录compileClasspath,但它是空集(注意allprojects中的构建任务执行日志)。为什么这不记录我在依赖项中的所有内容? (试图学习如何钓鱼/调试我的gradle问题,因为我的真正问题是编译没有为我的子项目找到我的罐子。)

请注意,构建输出以下行......数组中没有元素:(

MASTER:我现在正在构建classpath = []

allprojects {
    apply plugin: 'java'
    apply plugin: 'eclipse'

    buildDir = 'output'

    task hello << { task -> println "I'm $task.project.name" }
    build << { task -> println "MASTER: I'm building now classpath=$sourceSets.main.compileClasspath.files" }
}

subprojects {

    version = 'Developer-Build'
    project.ext.genLibDir = file('lib')
    project.ext.fixedLibDir = file('libother')

    repositories {
         mavenCentral()
    }

    //configurations.compile {
    //  exclude group: 'javax.jms',        module: 'jms'
    //  exclude group: 'com.sun.jdmk',     module: 'jmxtools'
    //  exclude group: 'com.sun.jmx',      module: 'jmxri'
    //}

    dependencies {
        compile group: 'org.hibernate',   name: 'hibernate-entitymanager', version: '4.1.4.Final'
        compile group: 'org.slf4j',       name: 'slf4j-api',               version: '1.6.6'
        compile group: 'org.slf4j',       name: 'log4j-over-slf4j',        version: '1.6.6'
        compile group: 'ch.qos.logback',  name: 'logback-core',            version: '1.0.6'
        compile group: 'joda-time',       name: 'joda-time',               version: '2.1'
        compile group: 'com.google.inject',name: 'guice',                  version: '3.0'
        compile group: 'com.google.protobuf',name: 'protobuf-java',        version: '2.4.1'


        //to be erased soon
        compile group: 'commons-configuration',name:'commons-configuration',version: '1.8'
        compile group: 'org.jboss.netty', name: 'netty',                   version: '3.2.7.Final'

        //compile group: 'org.asteriskjava',name: 'asterisk-java',         version: '1.0.0.M3'            
        compile fileTree(dir: project.ext.fixedLibDir, include: '*.jar')

        compile fileTree(dir: 'webserver/play-1.2.4/framework/lib', include: '*.jar')
        compile fileTree(dir: 'webserver/play-1.2.4/framework', include: '*.jar')
    }

1 个答案:

答案 0 :(得分:0)

我认为这现在有效,我发现fileTree对我不起作用,但其余的都在工作

gradle:dependencies

gradle依赖

这里有更好的答案......

what is the root of the path in gradle when using configuration injection?