feat(Java-Build): Additional Build Options in Maven and Gradle

This commit is contained in:
Marcel Feix 2022-05-25 14:49:40 +02:00
parent c58d3bed4d
commit e788ed7ce0
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03
5 changed files with 4 additions and 10 deletions

View File

@ -10,6 +10,7 @@ The resulting build files will be published as artefacts.
|===
|Name |Description | Default Value
|GRADLE_CLI_OPTS | Additional Options that will be passed to Gradle | ""
|GRADLE_CLI_BUILD_OPTS | Additional Options that will be passed to Gradle while Building | ""
|===
.gradle-build-template

View File

@ -7,6 +7,7 @@ These Templates will build a .jar file with Maven and provides it as an Artifact
.Variables
|===
|Name |Description | Default Value
|MAVEN_CLI_BUILD_OPTS | Additional Options that will be passed to Maven while Building | ""
|===
.mvn-build-template

View File

@ -27,14 +27,6 @@ Test-Java:
- job: "Build-Java"
artifacts: true
#todo put this into backend template
#Database-Diff:
# extends:
# - .maven-database-diff
# needs:
# - job: "Build-Java"
# artifacts: true
Repo-CVE-Scan:
allow_failure: true
extends: .repo-cve-scan-trivy

View File

@ -9,7 +9,7 @@
$(sed -i /^version/s/$GRADLE_VERSION/\'$CI_COMMIT_TAG\'/ $PATH_TO_VERSION_FILE)
fi
script:
- "./gradlew --build-cache assemble $GRADLE_CLI_OPTS"
- "./gradlew --build-cache assemble $GRADLE_CLI_BUILD_OPTS $GRADLE_CLI_OPTS"
artifacts:
expire_in: 2 weeks
when: on_success

View File

@ -9,7 +9,7 @@
fi
script:
- "cd $BACKEND_DIR"
- mvn $MAVEN_CLI_OPTS package -DskipTests
- mvn $MAVEN_CLI_OPTS package $MAVEN_CLI_BUILD_OPTS -DskipTests
artifacts:
expire_in: 2 weeks
when: always