From 57795f32a103496163a0057a75057976ea108b37 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 27 Jul 2018 18:39:38 +0800 Subject: [PATCH] build --- build.third_step0.gradle | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/build.third_step0.gradle b/build.third_step0.gradle index ef3a585be..c36b45186 100644 --- a/build.third_step0.gradle +++ b/build.third_step0.gradle @@ -65,6 +65,7 @@ publishing { groupId "com.fr.third" artifactId "fine-third" version maven_version + ext.repo = 'release' from components.java } @@ -72,15 +73,24 @@ publishing { groupId "com.fr.third" artifactId "fine-third" version maven_version_build + ext.repo = 'snapshot' from components.java } } repositories { maven { - - def releasesRepoUrl = "http://mvn.finedevelop.com/repository/fanruan-release/" - def snapshotsRepoUrl = "http://mvn.finedevelop.com/repository/fanruan/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + name "release" + url "http://mvn.finedevelop.com/repository/fanruan-release/" + credentials { + username = findProperty("NEXUS_USERNAME") + password = findProperty("NEXUS_PASSWORD") + } + + } + + maven { + name "snapshot" + url "http://mvn.finedevelop.com/repository/fanruan/" credentials { username = findProperty("NEXUS_USERNAME") password = findProperty("NEXUS_PASSWORD") @@ -90,6 +100,17 @@ publishing { } } + +afterEvaluate { + tasks.withType(PublishToMavenRepository) { task -> + if (task.publication.hasProperty('repo') && task.publication.repo != task.repository.name) { + task.enabled = false + task.group = null + } + } +} + + task unpack(type:Copy) { delete classesDir destinationDir=file(classesDir) @@ -117,5 +138,4 @@ task unpack(type:Copy) { } -jar.dependsOn unpack - +jar.dependsOn unpack \ No newline at end of file