Skip to content

Instantly share code, notes, and snippets.

@hellowdan
Last active June 15, 2021 15:34
Show Gist options
  • Save hellowdan/0984c250a8782870b493a7a9b925c3fb to your computer and use it in GitHub Desktop.
Save hellowdan/0984c250a8782870b493a7a9b925c3fb to your computer and use it in GitHub Desktop.
does this have any chance of working?
configFileProvider(
[configFile(fileId: "settings-local-maven-repo-nexus",
targetLocation: '$WORKSPACE/maven-invoker-settings.xml',
variable: 'MAVEN_INVOKER_SETTINGS')]) {
def mvnCmd = new MavenCommand(this, ['-fae'])
.inDirectory(env.MAIN_FOLDER)
.withOptions(["-f ${env.MAVEN_PROJECT}"])
.withProperty('java.net.preferIPv4Stack', true) // Added due to Openstack problems with IPv6
.withProperty(env.POM_FILE_PROPERTY, kogitoProps.getProp(env.PROPERTIES_FILE_LOOKUP_KEY))
.withProperty('native', nativeBuild)
.withProperty('invoker.settings.xml.file', ${env.MAVEN_INVOKER_SETTINGS})
if (env.MAVEN_EXTRA_PROPERTIES) {
env.MAVEN_EXTRA_PROPERTIES.split("\\|").each {
mvnCmd.withProperty(it)
}
}
try {
mvnCmd.run('clean verify')
} catch (err) {
unstable('Error in maven testing')
} finally {
// Archive
junit '**/target/surefire-reports/TEST-*.xml, **/target/failsafe-reports/TEST-*.xml'
archiveArtifacts artifacts: '**/*.log', allowEmptyArchive: true
// Cleanup
cloud.cleanContainersAndImages('docker')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment