• Gradle


    用以下build.gradle打包出来的jar包,依赖是分离的:

    apply plugin: 'java'
    
    dependencies {
        compile 'commons-codec:commons-codec:1.4'
        compile 'commons-logging:commons-logging:1.1.1'
        compile 'com.google.code.gson:gson:2.4'
        compile 'org.apache.httpcomponents:httpclient:4.3.6'
        compile 'com.strategicgains:RestExpress:0.11.2'
        compile 'com.fasterxml.jackson.core:jackson-databind:2.6.4'
        compile 'com.fasterxml.jackson.core:jackson-core:2.6.4'
        compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.4'
        compile "ch.qos.logback:logback-core:1.1.3"
        compile "ch.qos.logback:logback-classic:1.1.3"
        compile 'net.kencochrane.raven:raven-logback:6.0.0'
        compile 'net.kencochrane.raven:raven:6.0.0'
        compile "org.slf4j:slf4j-api:1.7.13"
        compile 'com.rabbitmq:amqp-client:4.1.0'
        compile 'org.apache.commons:commons-lang3:3.4'
        compile 'commons-net:commons-net:3.4'
        compile 'org.zeromq:jeromq:0.3.5'
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile project(':tc-das')
        compile project(':result-compare')
    }
    
    jar {
        manifest {
            attributes(
                    "Manifest-Version": 1.0,
                    "Main-Class": "com.testbird.rio.Main",
                    "Class-Path": configurations.compile.collect { "lib/${it.name}" }.join(' '))
        }
    }
    

    将build.gradle修改一下,就能将依赖和资源文件打入jar包了:

    apply plugin: 'java'
    
    dependencies {
        compile 'commons-codec:commons-codec:1.4'
        compile 'commons-logging:commons-logging:1.1.1'
        compile 'com.google.code.gson:gson:2.4'
        compile 'org.apache.httpcomponents:httpclient:4.3.6'
        compile 'com.strategicgains:RestExpress:0.11.2'
        compile 'com.fasterxml.jackson.core:jackson-databind:2.6.4'
        compile 'com.fasterxml.jackson.core:jackson-core:2.6.4'
        compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.4'
        compile "ch.qos.logback:logback-core:1.1.3"
        compile "ch.qos.logback:logback-classic:1.1.3"
        compile 'net.kencochrane.raven:raven-logback:6.0.0'
        compile 'net.kencochrane.raven:raven:6.0.0'
        compile "org.slf4j:slf4j-api:1.7.13"
        compile 'com.rabbitmq:amqp-client:4.1.0'
        compile 'org.apache.commons:commons-lang3:3.4'
        compile 'commons-net:commons-net:3.4'
        compile 'org.zeromq:jeromq:0.3.5'
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile project(':tc-das')
        compile project(':result-compare')
    }
    
    jar {
        manifest {
            attributes(
                    "Manifest-Version": 1.0,
                    "Main-Class": "com.testbird.rio.Main")
        }
        from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
        into('assets') {
            from 'assets'
        }
    }
    
  • 相关阅读:
    python中的BeautifulSoup使用小结
    python数字前自动补零
    python列表中的所有值转换为字符串,以及列表拼接成一个字符串
    python爬虫requests过程中添加headers
    django+mysql简单总结
    python数字转换为字符串的两种方式
    python自带的IDLE如何清屏
    django模板中的自定义过滤器
    python中的requests使用小结
    在非UI线程中自制Dispatcher
  • 原文地址:https://www.cnblogs.com/jyx140521/p/6855210.html
Copyright © 2020-2023  润新知