pipeline {
    agent any

    stages {
        stage('Security Scan') {
            steps {
                // Run OWASP Dependency Check using the specific installation configured in Jenkins
                dependencyCheck additionalArguments: '--scan ./ --format ALL', odcInstallation: 'depcheck'
            }
        }
    }

    post {
        always {
            // Publish the results
            dependencyCheckPublisher pattern: 'dependency-check-report.xml'
            
            // Archive the reports
            archiveArtifacts allowEmptyArchive: true, artifacts: 'dependency-check-report.html'
        }
    }
}
