-
Notifications
You must be signed in to change notification settings - Fork 12
add ci-reporting, errorprone profile and record static code analysis #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 16 commits
5a413e0
da1da5e
2a6fe1e
140cda6
574be23
6825fe6
705abf8
c2ae6d4
ad5a521
3dca602
3d7c1a6
ac4110b
5d038b8
d967299
1894836
738320e
c7f5c96
5169d37
00a3048
a7fc25d
3b5d022
04f5c7d
f1068e9
b556d75
c78fea7
0ae9ff7
89339f3
ddc14f0
32c0e47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,18 +38,21 @@ def call(Map params = [:]) { | |
// minimum, LTS, current and next ea | ||
def jdks = params.containsKey('jdks') ? params.jdks : params.containsKey('jdk') ? params.jdk : ['8','11','17'] | ||
def jdkMin = jdks[0]; | ||
def mavens = params.containsKey('maven') ? params.maven : ['3.2.x','3.3.x','3.5.x','3.6.x'] | ||
def mavens = params.containsKey('maven') ? params.maven : ['3.6.x','3.8.x'] | ||
// def failFast = params.containsKey('failFast') ? params.failFast : true | ||
// Just temporarily | ||
def failFast = false; | ||
def siteJdks = params.containsKey('siteJdk') ? params.siteJdk : ['8','17'] | ||
def siteMvn = params.containsKey('siteMvn') ? params.siteMvn : '3.6.x' | ||
def siteJdks = params.containsKey('siteJdk') ? params.siteJdk : ['8'] | ||
def siteMvn = params.containsKey('siteMvn') ? params.siteMvn : '3.8.x' | ||
def siteOses = params.containsKey('siteOs') ? params.siteOs : ['linux'] | ||
def tmpWs = params.containsKey('tmpWs') ? params.tmpWs : false | ||
|
||
taskContext['failFast'] = failFast; | ||
taskContext['tmpWs'] = tmpWs; | ||
taskContext['archives'] = params.archives | ||
taskContext['siteWithPackage'] = params.containsKey('siteWithPackage') ? params.siteWithPackage : false // workaround for MNG-7289 | ||
taskContext['extraCmd'] = params.containsKey('extraCmd') ? params.extraCmd : '' | ||
taskContext['ciReportingRunned'] = false | ||
|
||
Map tasks = [failFast: failFast] | ||
boolean first = true | ||
|
@@ -63,15 +66,16 @@ def call(Map params = [:]) { | |
def mvn = jenkinsEnv.mavenForJdk(jdk) | ||
doCreateTask( os, jdk, mvn, tasks, first, 'build', taskContext ) | ||
} | ||
|
||
for (def jdk in siteJdks) { | ||
// doesn't work for multimodules yet | ||
doCreateTask( os, jdk, siteMvn, tasks, first, 'site', taskContext ) | ||
} | ||
|
||
|
||
// run with apache-release profile, consider it a dryRun with SNAPSHOTs | ||
// doCreateTask( os, siteJdk, siteMvn, tasks, first, 'release', taskContext ) | ||
} | ||
for (String os in siteOses) { | ||
for (def jdk in siteJdks) { | ||
// doesn't work for multimodules yet | ||
doCreateTask( os, jdk, siteMvn, tasks, first, 'site', taskContext ) | ||
} | ||
} | ||
// run the parallel builds | ||
parallel(tasks) | ||
|
||
|
@@ -119,18 +123,25 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext ) | |
echo "Skipping ${os}-jdk${jdk} as unsupported by Jenkins Environment" | ||
return; | ||
} | ||
def recordReporting = false | ||
def cmd = [ | ||
'mvn', '-V', | ||
'-P+run-its', | ||
'-Dmaven.test.failure.ignore=true', | ||
'-Dfindbugs.failOnError=false', | ||
'-e', | ||
taskContext.extraCmd | ||
] | ||
if (!first) { | ||
cmd += '-Dfindbugs.skip=true' | ||
// } else { // Requires authorization on SonarQube first | ||
// cmd += 'sonar:sonar' | ||
} | ||
if (Integer.parseInt(jdk) >= 11 && !taskContext['ciReportingRunned']) { | ||
cmd += "-Pci-reporting -Perrorprone" | ||
|
||
taskContext['ciReportingRunned'] = true | ||
recordReporting = true | ||
} | ||
|
||
|
||
if (plan == 'build') { | ||
cmd += 'clean' | ||
|
@@ -213,6 +224,15 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext ) | |
} | ||
} | ||
} | ||
if(recordReporting) { | ||
recordIssues id: "${os}-jdk${jdk}", name: "Static Analysis", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne()] | ||
jacoco inclusionPattern: '**/org/apache/maven/**/*.class', | ||
exclusionPattern: '', | ||
execPattern: '**/target/jacoco.exec', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point to include IT test in coverage. |
||
classPattern: '**/target/classes', | ||
sourcePattern: '**/src/main/java' | ||
recordReporting = false; | ||
} | ||
} catch (Throwable e) { | ||
archiveDirs(taskContext.archives, stageDir) | ||
// First step to keep the workspace clean and safe disk space | ||
|
@@ -241,6 +261,6 @@ def archiveDirs(archives, stageDir) { | |
archives.each { archivePrefix, pathToContent -> | ||
zip(zipFile: "${archivePrefix}-${stageDir}.zip", dir: pathToContent, archive: true) | ||
} | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be at minimum 11, there are difference for javadoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhm not sure as javadoc can fail with jdk 1.8 and not 11. and the other way around :)
as we are 1.8 for most of the plugins etc maybe we need to ensure it works with this at least (as release folks might use 1.8 to build their release.