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

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 {

        maven {

url "http://localhost:8081/nexus/content/groups/public"

}

        mavenCentral()
    }

    uploadArchives {
        repositories {

            mavenDeployer {

repository(url: "http://localhost:8081/nexus/content/repositories/snapshots") {
               authentication(userName: "admin", password: "admin123")
  }

                mavenLocal()
            }
        }
    }

    dependencies {
    }

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

project(':context') {
    archivesBaseName = "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 {"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 = "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 = "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
}

}


说明:
  先执行gradle install
  然后执行gradle uload或者 <span style="font-family: Arial, Helvetica, sans-serif;">gradle  </span><span style="font-family: Arial, Helvetica, sans-serif;">uploadArchives</span>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值