Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
.codingstyle.4.10.0.source-code.Jenkinsfile.autograding Maven / Gradle / Ivy
node {
def mvnHome = tool 'mvn-default'
stage ('Checkout') {
checkout scm
}
stage ('Git mining') {
discoverGitReferenceBuild()
mineRepository()
}
stage ('Build, Test and Static Analysis') {
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
sh 'mvn -ntp -V -e clean verify -Dmaven.test.failure.ignore -Dgpg.skip'
}
recordIssues tools: [java(), javaDoc()], aggregatingResults: 'true', id: 'java', name: 'Java'
recordIssues tool: errorProne(), healthy: 1, unhealthy: 20
junit testResults: '**/target/*-reports/TEST-*.xml'
recordCoverage tools: [[parser: 'JACOCO']], sourceCodeRetention: 'EVERY_BUILD', name: 'Code Coverage'
recordIssues tools: [checkStyle(pattern: 'target/checkstyle-result.xml'),
spotBugs(pattern: 'target/spotbugsXml.xml'),
pmdParser(pattern: 'target/pmd.xml'),
cpd(pattern: 'target/cpd.xml'),
taskScanner(highTags:'FIXME', normalTags:'TODO', includePattern: '**/*.java', excludePattern: 'target/**/*')],
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
}
stage ('Mutation Coverage') {
withMaven(maven: 'mvn-default', mavenLocalRepo: '/var/data/m2repository', mavenOpts: '-Xmx768m -Xms512m') {
sh "mvn -ntp org.pitest:pitest-maven:mutationCoverage"
}
recordCoverage tools: [[parser: 'PIT']], id: 'pit', name: 'Mutation Coverage', sourceCodeRetention: 'EVERY_BUILD'
}
stage ('Collect Maven Warnings') {
recordIssues tool: mavenConsole()
}
stage ('Autograding') {
autoGrade('''
{
"tests": {
"tools": [
{
"name": "Tests"
}
],
"name": "JUnit",
"passedImpact": 0,
"skippedImpact": -1,
"failureImpact": -5,
"maxScore": 100
},
"analysis": [
{
"name": "Style",
"id": "style",
"tools": [
{
"id": "checkstyle",
"name": "CheckStyle"
},
{
"id": "pmd",
"name": "PMD"
}
],
"errorImpact": -1,
"highImpact": -1,
"normalImpact": -1,
"lowImpact": -1,
"maxScore": 100
},
{
"name": "Bugs",
"id": "bugs",
"icon": "bug",
"tools": [
{
"id": "spotbugs",
"name": "SpotBugs"
}
],
"errorImpact": -3,
"highImpact": -3,
"normalImpact": -3,
"lowImpact": -3,
"maxScore": 100
}
],
"coverage": [
{
"tools": [
{
"id": "coverage",
"name": "Line Coverage",
"metric": "line"
},
{
"id": "coverage",
"name": "Branch Coverage",
"metric": "branch"
}
],
"name": "Code Coverage",
"maxScore": 100,
"missedPercentageImpact": -1
},
{
"tools": [
{
"id": "pit",
"name": "Mutation Coverage",
"metric": "mutation"
}
],
"name": "Mutation Coverage",
"maxScore": 100,
"missedPercentageImpact": -1
}
]
}
''')
}
}