修改net-paoding项目的build.gradle文件,使用gradle install发布到本地maven仓库

来源:互联网 发布:linux c 单例日志类 编辑:程序博客网 时间:2024/05/17 01:04

subprojects {
    apply plugin: 'java'
    apply plugin: 'maven'
    apply plugin: 'eclipse'
    
    group = "net.paoding"
    version = "1.2-SNAPSHOT"

    sourceCompatibility = 1.6
    [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

    repositories {
        mavenRepo url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
        mavenCentral()
    }

    uploadArchives {
        repositories {
            mavenDeployer {
                mavenLocal()
            }
        }
    }

    dependencies {
    }

    jar {
        manifest.attributes "Implementation-Title": "paoding-rose", "Implementation-Version": version
    }
}

project(':context') {
    archivesBaseName = "paoding-rose-context"
    dependencies {
        testCompile "junit:junit:4.7"
        compile "javax.servlet:servlet-api:2.4"
        compile "commons-logging:commons-logging:1.1.1"
        compile "commons-lang:commons-lang:2.6"
        compile "commons-collections:commons-collections:3.2.1"
        compile "org.springframework:spring-context:3.1.2.RELEASE"
        compile "org.springframework:spring-web:3.1.2.RELEASE"
    }
}

project(':rose') {
    project.metaClass.getName {"paoding-rose"}
    archivesBaseName = "paoding-rose"
    dependencies {
        compile project(':context')
           testCompile "junit:junit:4.7"
           compile "javax.servlet:servlet-api:2.4"
           compile "commons-logging:commons-logging:1.1.1"
           compile "commons-lang:commons-lang:2.6"
           compile "commons-collections:commons-collections:3.2.1"
           compile "org.springframework:spring-context:3.1.2.RELEASE"
           compile "org.springframework:spring-web:3.1.2.RELEASE"
           compile "log4j:log4j:1.2.17"
           compile "javax.servlet:jsp-api:2.0"
           compile "commons-fileupload:commons-fileupload:1.2.2"
           compile "org.springframework:spring-webmvc:3.1.2.RELEASE"
           testCompile "org.springframework:spring-mock:2.0.8"
           compile "org.apache.velocity:velocity:1.7"
           compile "org.apache.velocity:velocity-tools:2.0"

    }
}

project(':jade') {
    archivesBaseName = "paoding-rose-jade"
    dependencies {
        compile project(':context')
        testCompile "junit:junit:4.7"
        compile "javax.servlet:servlet-api:2.4"
        compile "commons-logging:commons-logging:1.1.1"
        compile "commons-lang:commons-lang:2.6"
        compile "commons-jexl:commons-jexl:1.1"
        compile "commons-collections:commons-collections:3.2.1"
        compile "org.springframework:spring-context:3.1.2.RELEASE"
        compile "org.springframework:spring-jdbc:3.1.2.RELEASE"
        testCompile "org.hsqldb:hsqldb:2.2.8"
    }
}

project(':pipe') {
    archivesBaseName = "paoding-rose-pipe"
    dependencies {
        compile project(':rose')
        testCompile "junit:junit:4.7"
        compile "javax.servlet:servlet-api:2.4"
        compile "javax.servlet:jsp-api:2.0"
        compile "com.metaparadigm:json-rpc:1.0"
    }
}

subprojects{
    configure(install.repositories.mavenInstaller) {
    pom.project {
        groupId 'net.paoding'
        artifactId project.name
        packaging 'jar'
        }
    }

task sourcesJar(type: Jar, dependsOn:classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn:javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}
}
0 0
原创粉丝点击