From b360ae81bb87207e49e01281fa82b59b375822a4 Mon Sep 17 00:00:00 2001 From: Tal Moran Date: Wed, 25 Jan 2017 19:10:18 +0200 Subject: [PATCH] Fix gradle build files to work without nexus repository credentials --- build.gradle-template | 13 ++++++----- bulletin-board-client/build.gradle | 11 ++++++--- bulletin-board-server/build.gradle | 30 +++++++++---------------- distributed-key-generation/build.gradle | 16 ++++++++----- meerkat-common/build.gradle | 15 ++++++++----- mixer/build.gradle | 13 +++++++---- polling-station/build.gradle | 13 +++++++---- restful-api-common/build.gradle | 13 +++++++---- voting-booth/build.gradle | 13 +++++++---- 9 files changed, 83 insertions(+), 54 deletions(-) diff --git a/build.gradle-template b/build.gradle-template index f80c9f3..9832d46 100644 --- a/build.gradle-template +++ b/build.gradle-template @@ -25,8 +25,11 @@ ext { // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "TODO: Add a description" @@ -207,12 +210,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/bulletin-board-client/build.gradle b/bulletin-board-client/build.gradle index f870887..0365e0b 100644 --- a/bulletin-board-client/build.gradle +++ b/bulletin-board-client/build.gradle @@ -16,6 +16,11 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "Meerkat Voting Common Library" @@ -196,12 +201,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/bulletin-board-server/build.gradle b/bulletin-board-server/build.gradle index 2ab85b0..a7a0418 100644 --- a/bulletin-board-server/build.gradle +++ b/bulletin-board-server/build.gradle @@ -21,7 +21,12 @@ apply plugin: 'maven-publish' ext { isSnapshot = false } ext { - groupId = 'org.factcenter.meerkat' + groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "Bulletin-board server web application" @@ -179,25 +184,10 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) { *===================================*/ repositories { - - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } - // Use local maven repository mavenLocal() - jcenter() + //jcenter() // Use 'maven central' for other dependencies. mavenCentral() @@ -233,12 +223,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/distributed-key-generation/build.gradle b/distributed-key-generation/build.gradle index b47e8f2..84f3ad1 100644 --- a/distributed-key-generation/build.gradle +++ b/distributed-key-generation/build.gradle @@ -20,10 +20,16 @@ apply plugin: 'maven-publish' ext { isSnapshot = false } ext { - groupId = 'org.factcenter.meerkat' + groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" + } -description = "TODO: Add a description" +description = "Distributed key generation code" // Your project version version = "0.0" @@ -181,12 +187,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/meerkat-common/build.gradle b/meerkat-common/build.gradle index bc380ed..e019d59 100644 --- a/meerkat-common/build.gradle +++ b/meerkat-common/build.gradle @@ -19,7 +19,12 @@ mainClassName='Demo' ext { isSnapshot = false } ext { - groupId = 'org.factcenter.meerkat' + groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "Meerkat Voting Common Library" @@ -46,7 +51,7 @@ dependencies { compile 'com.google.guava:guava:15.0' // Crypto - compile 'org.factcenter.qilin:qilin:1.3.+' + compile 'org.factcenter.qilin:qilin:1.2.+' compile 'org.bouncycastle:bcprov-jdk15on:1.53' testCompile 'junit:junit:4.+' @@ -188,12 +193,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/mixer/build.gradle b/mixer/build.gradle index bdde270..2cbf45d 100644 --- a/mixer/build.gradle +++ b/mixer/build.gradle @@ -20,7 +20,12 @@ mainClassName='meerkat.mixer.main.Mix' ext { isSnapshot = false } ext { - groupId = 'org.factcenter.meerkat' + groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "Mix network implementation" @@ -166,12 +171,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/polling-station/build.gradle b/polling-station/build.gradle index c45498f..bf1c1a9 100644 --- a/polling-station/build.gradle +++ b/polling-station/build.gradle @@ -21,7 +21,12 @@ apply plugin: 'maven-publish' ext { isSnapshot = false } ext { - groupId = 'org.factcenter.meerkat' + groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "Meerkat polling-station application" @@ -157,12 +162,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/restful-api-common/build.gradle b/restful-api-common/build.gradle index 937b79d..07ef0af 100644 --- a/restful-api-common/build.gradle +++ b/restful-api-common/build.gradle @@ -18,7 +18,12 @@ apply plugin: 'maven-publish' ext { isSnapshot = false } ext { - groupId = 'org.factcenter.meerkat' + groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "Common classes for implementing Meerkat's RESTful API" @@ -118,12 +123,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } } diff --git a/voting-booth/build.gradle b/voting-booth/build.gradle index 682f398..e5dd671 100644 --- a/voting-booth/build.gradle +++ b/voting-booth/build.gradle @@ -19,7 +19,12 @@ apply plugin: 'maven-publish' ext { isSnapshot = false } ext { - groupId = 'org.factcenter.meerkat' + groupId = 'org.factcenter.meerkat' + + // Credentials for publishing repositories + publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : "" + publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : "" } description = "Meerkat voting booth application" @@ -160,12 +165,12 @@ publishing { } repositories { maven { - url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" + url publishRepository credentials { username password - username nexusUser - password nexusPassword + username publishUser + password publishPassword } } }