diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..071ce4f46 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent any + + tools { + // Install the Maven version configured as "M3" and add it to the path. + gradle "8.6" + } + + stages { + stage('Build') { + steps { + // Get some code from a GitHub repository + git 'https://github.com/jglick/simple-maven-project-with-tests.git' + + // Run Maven on a Unix agent. + sh "mvn -Dmaven.test.failure.ignore=true clean package" + + // To run Maven on a Windows agent, use + // bat "mvn -Dmaven.test.failure.ignore=true clean package" + } + + post { + // If Maven was able to run the tests, even if some of the test + // failed, record the test results and archive the jar file. + success { + junit '**/target/surefire-reports/TEST-*.xml' + archiveArtifacts 'target/*.jar' + } + } + } + } +} diff --git a/build.gradle b/build.gradle index 5a3400213..57ca80323 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,5 @@ import java.awt.Desktop -ext { - checkstyleVersion = '10.14.2' -} - plugins { id 'java' id 'org.springframework.boot' version '3.2.0' @@ -41,15 +37,11 @@ java { } checkstyle { - toolVersion = checkstyleVersion + toolVersion = '10.14.2' } repositories { mavenCentral() - maven { - url 'http://localhost:9081/repository/maven-central-proxy/' - allowInsecureProtocol = true - } } ext.webjarsFontawesomeVersion = "4.7.0" @@ -130,36 +122,6 @@ task listRepos { } } -publishing { - publications { - maven(MavenPublication) { - artifact("build/libs/$rootProject.name-$version"+".jar") { - extension 'jar' - } - } - } - repositories { - maven { - name 'nexus-releases-private' - name 'Nexus_Repo' - def releasesRepoUrl = 'http://localhost:9081/repository/maven-releases-private/' - def snapshotsRepoUrl = 'http://localhost:9081/repository/maven-snapshost-private/' - url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - - allowInsecureProtocol = true - - credentials { - username project.repoUser - password project.repoPassword - } - } - } -} - -tasks.named('publishMavenPublicationToNexus_RepoRepository') { - mustRunAfter('bootJar') -} - checkstyleAot.enabled = false checkstyleAotTest.enabled = false