Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings.gradle:
- includeFlat 'projA','projB','projC'
- projA-build.gradle:
- compile project(":projB")
- Could not resolve all dependencies for configuration ':runtime'.
- Could not find master:restclient:4.0-SNAPSHOT.
- subprojects {
- afterEvaluate { Project proj ->
- def is_snap = false
- def reltype = "releases"
- def artifact_name = sprintf("%s-%s.jar"
- ,project['name']
- ,project['version'])
- def nexus_release_path = sprintf("%s/nexus/content/repositories/releases/%s/%s/%s/%s"
- ,project['nexus_url']
- ,project['groupId'].replaceAll("\.","/")
- ,project['name']
- ,project['version']
- ,artifact_name
- )
- if(project.version.contains("SNAPSHOT")){
- reltype = "snapshots"
- is_snap = true
- }
- uploadArchives {
- // only try the upload if it's not already there
- onlyIf {
- try {
- def artifact_exists = new URL(nexus_release_path).bytes
- // if we get here then the artifact existed and we only want to
- // build if this is a snapshot version
- is_snap || false
- } catch (FileNotFoundException e) {
- // this means we couldn't find the artifact in nexus
- if(!is_snap){
- println "NOTE ==> Don't forget to create new git tag for $artifact_name!"
- }
- true
- }
- }
- repositories {
- mavenDeployer {
- repository(url: "${project.nexus_url}/nexus/content/repositories/$reltype") {
- authentication(userName: project.nexus_user, password: project.nexus_password)
- }
- pom.version = "${project['version']}"
- pom.artifactId = "${project.name}"
- pom.groupId = "${groupId}"
- }
- }
- }
- ...
- }
Add Comment
Please, Sign In to add comment