gradle - 如何记录用于gradle编译的jar

标签 gradle

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

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

主持人:我现在正在建立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')
    }

最佳答案

我认为这现在可以正常工作,并且发现fileTree对我来说不起作用,但是其余的都在起作用

gradle:依赖

要么

gradle依赖

更好的答案在这里。

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

关于gradle - 如何记录用于gradle编译的jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11160846/

相关文章:

java - 当我构建Docker镜像时,Gradle测试由于UnsupportedClassVersionError而失败-在本地运行良好

windows - 如何在依赖于操作系统的 gradle 条件下应用插件

windows-7 - IntelliJ 终端设置

android - 无法删除导致库版本冲突的外部库

gradle - 使用 Gradle 查找依赖树

git - Intellij 导入问题 - java.io.IOException : Cannot run program "git": error=2, 没有这样的文件或目录

android - 在 gradle 中定义可从任何子模块访问的枚举

android - Gradle Android 插件 - 添加自定义 flavor 属性?

android - Volley 作为依赖

heroku - 如何在不使用 gradle publish 命令的情况下发布 Gradle 工件