Skip to content

Commit

Permalink
Merge pull request #16 from ctownshend/BenchmarkJava
Browse files Browse the repository at this point in the history
Benchmark java
  • Loading branch information
ctownshend committed Aug 5, 2024
2 parents bd8b23b + ac6f1c0 commit 575e78b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Java CI with Maven

on: [push, pull_request]
env:
SONATYPE_LIFECYCLE_APPLICATION_ID: $(echo "${{ github.repository }}" | cut -d '/' -f2)

jobs:
build:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@master
with:
name: OWASP-Benchmark/BenchmarkJava
ref: refs/heads/release
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
- name: Run Spotless check
run: mvn spotless:check
- name: Create WAR
run: mvn package
- name: Sonatype Lifecycle Policy Evaluation
uses: sonatype-nexus-community/iq-github-action@v2
with:
serverUrl: ${{ secrets.SONATYPE_LIFECYCLE_URL }}
username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }}
password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }}
applicationId: ${{ env.SONATYPE_LIFECYCLE_APPLICATION_ID }}
stage: Build
target: ./target/

24 changes: 24 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pipeline {
agent {
label 'maven-node'
}
stages {
stage('Pull Source') {
// Get some code from a GitHub repository
steps {
git url: 'https://github.com/OWASP-Benchmark/BenchmarkJava.git'
}
}
stage('Build & Install') {
steps {
echo "Performing maven build"
sh 'mvn clean install'
}
}
stage('Nexus Lifecycle Evaluation') {
steps {
nexusPolicyEvaluation failBuildOnNetworkError: false, iqApplication: "${env.JOB_BASE_NAME}", iqStage: 'build', jobCredentialsId: ''
}
}
}
}

0 comments on commit 575e78b

Please sign in to comment.