@ -47,7 +47,7 @@ def date = new Date()
def formattedDate = date . format ( 'yyyy.MM.dd' )
def formattedDate = date . format ( 'yyyy.MM.dd' )
def srcDir = "."
def srcDir = "."
def maven_version_build = ""
def maven_version = ""
def indexV = branchName . indexOf ( "%2F" ) ;
def indexV = branchName . indexOf ( "%2F" ) ;
// "FEATURE" , "RELEASE" 等 等
// "FEATURE" , "RELEASE" 等 等
@ -56,13 +56,13 @@ String branchNameUpperCase = "RELEASE"
if ( indexV ! = - 1 ) {
if ( indexV ! = - 1 ) {
version = branchName . substring ( indexV + 3 , branchName . length ( ) ) . toUpperCase ( )
version = branchName . substring ( indexV + 3 , branchName . length ( ) ) . toUpperCase ( )
branchNameUpperCase = branchName . substring ( 0 , indexV ) . toUpperCase ( )
branchNameUpperCase = branchName . substring ( 0 , indexV ) . toUpperCase ( )
maven_version_build = project . version + "-" + branchNameUpperCase + "-SNAPSHOT"
maven_version = project . version + "-" + branchNameUpperCase + "-SNAPSHOT"
} else {
} else {
version = branchName
version = branchName
maven_version_build = project . version + "-SNAPSHOT"
maven_version = project . version + "-SNAPSHOT"
}
}
def maven_version = "${version}.${formattedDate}"
// def maven_version = "${version}.${formattedDate}"
def jar_version = version
def jar_version = version
configurations {
configurations {
@ -90,45 +90,18 @@ publishing {
groupId "com.fr.third"
groupId "com.fr.third"
artifactId "fine-third"
artifactId "fine-third"
version maven_version
version maven_version
ext . repo = 'release'
from components . java
from components . java
pom . withXml {
pom . withXml {
def dep = asNode ( ) . appendNode ( 'dependencies' ) ;
def dep = asNode ( ) . appendNode ( 'dependencies' ) ;
def node = dep . appendNode ( "dependency" )
def node = dep . appendNode ( "dependency" )
node . appendNode ( "groupId" , "com.fr.cbb" )
node . appendNode ( "groupId" , "com.fr.cbb" )
node . appendNode ( "artifactId" , "fine-cbb" )
node . appendNode ( "artifactId" , "fine-cbb" )
node . appendNode ( "version" , "${cbbVersion}" )
node . appendNode ( "version" , "${maven_version}" )
}
}
third_build ( MavenPublication ) {
groupId "com.fr.third"
artifactId "fine-third"
version maven_version_build
ext . repo = 'snapshot'
from components . java
pom . withXml {
def dep = asNode ( ) . appendNode ( 'dependencies' ) ;
def node = dep . appendNode ( "dependency" )
node . appendNode ( "groupId" , "com.fr.cbb" )
node . appendNode ( "artifactId" , "fine-cbb" )
node . appendNode ( "version" , "${cbbVersion}" )
}
}
}
}
}
}
repositories {
repositories {
maven {
maven {
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/"
url "http://mvn.finedevelop.com/repository/fanruan/"
credentials {
credentials {
username = findProperty ( "NEXUS_USERNAME" )
username = findProperty ( "NEXUS_USERNAME" )
@ -139,16 +112,6 @@ 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 ) {
task unpack ( type: Copy ) {
delete classesDir
delete classesDir
destinationDir = file ( classesDir )
destinationDir = file ( classesDir )