Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes jcenter repository and fixes deprecated libraries no more available #108

Merged
merged 12 commits into from
Jul 6, 2022
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed
- Github template tests fail in proxy environment ([#56](https://github.com/opendevstack/ods-document-generation-svc/issues/56))
- Jcenter repository not available and build step fails ([#106](https://github.com/opendevstack/ods-document-generation-svc/issues/106))
- Dependencies no more availables changed ([108](https://github.com/opendevstack/ods-document-generation-svc/issues/108))

## [4.0] - 2021-15-11

Expand Down
26 changes: 24 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,37 @@ def stageBuild(def context) {
// get wkhtml
sh (
script : """
curl -kLO https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
curl -sSkLO https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar vxf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin

source use-j11.sh || echo 'ERROR: We could NOT setup jdk 11.'
./gradlew --version || echo 'ERROR: Could NOT get gradle version.'
java -version || echo 'ERROR: Could NOT get java version.'
echo "JAVA_HOME: $JAVA_HOME" || echo "ERROR: JAVA_HOME has NOT been set."

""",
label : "get and install wkhtml"
)

def status = sh(
script: "./gradlew clean test shadowJar --stacktrace --no-daemon",
script: '''
source use-j11.sh

retryNum=0
downloadResult=1
while [ 0 -ne $downloadResult ] && [ 5 -gt $retryNum ]; do
set -x
./gradlew -i dependencies
set +x
downloadResult=$?
let "retryNum=retryNum+1"
done

set -x
./gradlew -i clean test shadowJar --full-stacktrace --no-daemon
set +x
''',
label : "gradle build",
returnStatus: true
)
Expand Down
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ repositories {
if (no_nexus) {
println("using repository 'mavenCentral', because property no_nexus=$no_nexus")
mavenCentral()
maven() {
url "https://plugins.gradle.org/m2/"
}
} else {
println("using nexus repositories")

Expand All @@ -87,6 +90,10 @@ repositories {
password = "${nexus_pw}"
}
}

maven() {
url "https://plugins.gradle.org/m2/"
}
}
}

Expand Down
21 changes: 10 additions & 11 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@ ext {

repositories {
if (no_nexus) {
println("using repositories 'jcenter' and 'mavenCentral', because property no_nexus=$no_nexus")
jcenter()
println("INFO: using repository 'mavenCentral', because property no_nexus=$no_nexus")
mavenCentral()
} else {
println("using nexus repositories")
maven() {
url "${nexus_url}/repository/jcenter/"
credentials {
username = "${nexus_user}"
password = "${nexus_pw}"
}
url "https://plugins.gradle.org/m2/"
}
} else {
println("INFO: using nexus repositories")

maven() {
url "${nexus_url}/repository/maven-public/"
Expand All @@ -46,13 +41,17 @@ repositories {
password = "${nexus_pw}"
}
}

maven() {
url "https://plugins.gradle.org/m2/"
}
}
}

apply plugin: 'groovy'

dependencies {
implementation gradleApi()
implementation 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
implementation "org.codehaus.plexus:plexus-utils:3.0.24"
}
implementation "com.github.jengelman.gradle.plugins:shadow:5.2.0"
}