Skip to content

Commit

Permalink
Fix Gradle dependencies error
Browse files Browse the repository at this point in the history
  • Loading branch information
metmajer committed Dec 30, 2019
1 parent 9e11827 commit 8372d1a
Showing 1 changed file with 73 additions and 48 deletions.
121 changes: 73 additions & 48 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,90 +1,115 @@
buildscript {
ext {
joobyVersion = "1.6.2"
nexus_url = "${project.findProperty('nexus_url') ?: System.getenv('NEXUS_HOST')}"
nexus_user = "${project.findProperty('nexus_user') ?: System.getenv('NEXUS_USERNAME')}"
nexus_pw = "${project.findProperty('nexus_pw') ?: System.getenv('NEXUS_PASSWORD')}"
no_nexus = (project.findProperty('no_nexus') ?: System.getenv('NO_NEXUS') ?: false).toBoolean()
if (!no_nexus && (nexus_url == "null" || nexus_user == "null" || nexus_pw == "null")) {
throw new GradleException("property no_nexus='false' (or not defined) but at least one of the properties nexus_url, nexus_user or nexus_pw is not configured. Please configure those properties!")
}

def folderRel = (String)("${project.findProperty('nexus_folder_releases') ?: System.getenv('NEXUS_FOLDER_RELEASES')}")
nexusFolderReleases = folderRel == "null" ? "maven-releases" : folderRel

nexus_url = "${project.findProperty('nexus_url') ?: System.getenv('NEXUS_HOST')}"
nexus_user = "${project.findProperty('nexus_user') ?: System.getenv('NEXUS_USERNAME')}"
nexus_pw = "${project.findProperty('nexus_pw') ?: System.getenv('NEXUS_PASSWORD')}"
nexus_folder = "candidates"
def folderSnaps = (String)("${project.findProperty('nexus_folder_snapshots') ?: System.getenv('NEXUS_FOLDER_SNAPSHOTS')}")
nexusFolderSnapshots = folderSnaps == "null" ? "maven-snapshots" : folderSnaps

snippetsDir = file('build/generated-snippets')
}

repositories {
maven () {
url "${nexus_url}/repository/jcenter/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
if (no_nexus) {
println("using repositories 'jcenter' and 'mavenCentral', because property no_nexus=$no_nexus")
jcenter()
mavenCentral()
} else {
println("using nexus repositories")
maven() {
url "${nexus_url}/repository/jcenter/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
}

maven () {
url "${nexus_url}/repository/maven-public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
maven() {
url "${nexus_url}/repository/maven-public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
}

maven () {
url "${nexus_url}/repository/atlassian_public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
maven() {
url "${nexus_url}/repository/atlassian_public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
}
}
}

buildscript {
ext {
joobyVersion = "1.6.6"
}

dependencies {
classpath "com.google.gradle:osdetector-gradle-plugin:1.6.2"
classpath "io.spring.gradle:dependency-management-plugin:1.0.7.RELEASE"
classpath "org.jooby:jooby-gradle-plugin:$joobyVersion"
}
}

plugins {
id "com.github.johnrengelman.shadow" version "5.1.0"
id "com.google.osdetector" version "1.6.2"
id "io.spring.dependency-management" version "1.0.8.RELEASE"
}

apply plugin: "io.spring.dependency-management"
apply plugin: "com.google.osdetector"
apply plugin: "application"
apply plugin: "distribution"
apply plugin: "groovy"
apply plugin: "jooby"

group = 'org.ods'
version = '0.1'
mainClassName = "app.App"
sourceCompatibility = 1.8

repositories {
maven () {
url "${nexus_url}/repository/jcenter/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
if (no_nexus) {
println("using repositories 'jcenter' and 'mavenCentral', because property no_nexus=$no_nexus")
jcenter()
mavenCentral()
} else {
println("using nexus repositories")
maven() {
url "${nexus_url}/repository/jcenter/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
}

maven () {
url "${nexus_url}/repository/maven-public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
maven() {
url "${nexus_url}/repository/maven-public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
}

maven () {
url "${nexus_url}/repository/atlassian_public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
maven() {
url "${nexus_url}/repository/atlassian_public/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
}
}
}

group = 'org.ods'
version = '0.1'
mainClassName = "app.App"
sourceCompatibility = 1.8

dependencyManagement {
imports {
mavenBom "org.jooby:jooby-bom:$joobyVersion"
Expand Down

0 comments on commit 8372d1a

Please sign in to comment.