Skip to content

Commit

Permalink
Build with parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
kifj committed Jan 20, 2024
1 parent 51167f3 commit 53026a7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
properties([
parameters([
booleanParam(name: 'DEPENDENCY_TRACK', defaultValue: false, description: 'Upload BOM to Dependency Track'),
])
])

node {
def mvnHome = tool 'Maven-3.9'
env.JAVA_HOME = tool 'JDK-21'
Expand Down Expand Up @@ -46,8 +52,10 @@ node {
}

stage('dependencyTrack') {
withCredentials([string(credentialsId: 'dtrack', variable: 'API_KEY')]) {
dependencyTrackPublisher artifact: 'target/bom.xml', projectName: "${pom.artifactId}", projectVersion: "${pom.version}", synchronous: true, dependencyTrackApiKey: API_KEY, projectProperties: [group: "${pom.groupId}"]
if (params.DEPENDENCY_TRACK) {
withCredentials([string(credentialsId: 'dtrack', variable: 'API_KEY')]) {
dependencyTrackPublisher artifact: 'target/bom.xml', projectName: "${pom.artifactId}", projectVersion: "${pom.version}", synchronous: true, dependencyTrackApiKey: API_KEY, projectProperties: [group: "${pom.groupId}"]
}
}
}

Expand Down

0 comments on commit 53026a7

Please sign in to comment.