Created
December 11, 2014 02:21
-
-
Save anonymous/01b31c26eca7a507c14f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group="test" | |
version = "1.0.0" | |
import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact | |
apply plugin: 'java' | |
apply plugin: 'maven' | |
def aJar = file("build/A.jar") | |
def bJar = file("build/B.jar") | |
artifacts{ | |
//archives aJar | |
//archives bJar | |
// archives file: file('A.jar'), name: 'A', type: 'jar' | |
// archives file: file('B.jar'), name: 'B', type: 'jar' | |
archives new DefaultPublishArtifact("A", "jar", "jar", null, new | |
Date(), new File("$buildDir", "A.jar")) | |
archives new DefaultPublishArtifact("B", "jar", "jar", null, new | |
Date(), new File("$buildDir", "B.jar")) | |
} | |
uploadArchives(){ | |
repositories { | |
mavenDeployer { | |
addFilter("A") {artifact, file -> | |
artifact.name == "B" | |
} | |
addFilter("B") {artifact, file -> | |
artifact.name == "B" | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// addfilter A with b, and the first addfilter inside mavendeployer dosnt works, here is slight change in the upload archives code that worked for me...
uploadArchives(){
repositories {
mavenDeployer {
repository(url: "$archivaUrl") {
authentication(userName: "$userName", password: "$passWord")
}
addFilter("A") {artifact, file ->
artifact.name == "A"
}
addFilter("B") {artifact, file ->
artifact.name == "B"
}
}
}
}