diff --git a/Jenkinsfile b/Jenkinsfile index b50f17e7c63ec943b303af390d2cc5d01a6e967d..09b74a4b9de922106d21cc4cc8040ba8b655a3ba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,54 +62,12 @@ pipeline { sh 'mvn --version' configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { sh 'mvn -s $MAVEN_SETTINGS clean install -Dmaven.wagon.http.retryHandler.count=3' - - /* script { - try { - if (env.BRANCH_NAME == 'master') { - withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'mvn -s $MAVEN_SETTINGS sonar:sonar' - } - } - } catch (Exception e) { - unstable("SonarQube failed") - } - } - }*/ } } } } - /* stage('Build Pluto-Interface') { - steps { - script { - FAILED_STAGE=env.STAGE_NAME - } - container("maven-17"){ - sh 'mvn --version' - dir('pluto-interface') { - configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { - sh 'mvn -s $MAVEN_SETTINGS clean install -Dmaven.wagon.http.retryHandler.count=3' - - script { - try { - if (env.BRANCH_NAME == 'master') { - withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'mvn -s $MAVEN_SETTINGS sonar:sonar' - } - } - } catch (Exception e) { - unstable("SonarQube failed") - } - } - } - } - } - - } - }*/ - stage('Deploy to Nexus'){ when { anyOf { @@ -130,128 +88,7 @@ pipeline { } } - /* stage('Deploy Pluto-Interface to Nexus'){ - when { - anyOf { - branch 'master' - branch 'release' - } - } - steps { - script { - FAILED_STAGE = env.STAGE_NAME - } - container('maven-17') { - dir('pluto-interface') { - configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { - sh 'mvn -s $MAVEN_SETTINGS -DskipTests clean deploy' - } - } - } - } - } - - - - stage('Build Mail-Service') { - steps { - script { - FAILED_STAGE=env.STAGE_NAME - } - container("maven-17"){ - sh 'mvn --version' - dir('mail-service') { - configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { - sh 'mvn -s $MAVEN_SETTINGS clean install spring-boot:build-image -Dmaven.wagon.http.retryHandler.count=3' - - script { - try { - if (env.BRANCH_NAME == 'master') { - withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'mvn -s $MAVEN_SETTINGS sonar:sonar' - } - } - } catch (Exception e) { - unstable("SonarQube failed") - } - } - } - } - } - } - } - - stage('Deploy mail-service to Nexus'){ - when { - anyOf { - branch 'master' - branch 'release' - } - } - steps { - script { - FAILED_STAGE = env.STAGE_NAME - } - container('maven-17') { - dir('mail-service') { - configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { - sh 'mvn -s $MAVEN_SETTINGS -DskipTests deploy' - } - } - } - } - } - - stage('Build Pluto-Server') { - steps { - script { - FAILED_STAGE=env.STAGE_NAME - } - container("maven-17"){ - sh 'mvn --version' - dir('pluto-server') { - configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { - sh 'mvn -s $MAVEN_SETTINGS clean install spring-boot:build-image -Dmaven.wagon.http.retryHandler.count=3' - - script { - try { - if (env.BRANCH_NAME == 'master') { - withSonarQubeEnv('sonarqube-ozg-sh'){ - sh 'mvn -s $MAVEN_SETTINGS sonar:sonar' - } - } - } catch (Exception e) { - unstable("SonarQube failed") - } - } - } - } - } - } - } - - stage('Deploy Pluto-Server to Nexus'){ - when { - anyOf { - branch 'master' - branch 'release' - } - } - steps { - script { - FAILED_STAGE = env.STAGE_NAME - } - container('maven-17') { - dir('pluto-server') { - configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { - sh 'mvn -s $MAVEN_SETTINGS -DskipTests deploy' - } - } - } - } - }*/ - stage('Build Docker image') { steps { script { diff --git a/pluto-interface/lombok.config b/pluto-interface/lombok.config index 18425cbe760cb52e8cdeb27cb45b13b620b1daa9..4cbb865834f6128b8ddc16fc9b1966af99e52653 100644 --- a/pluto-interface/lombok.config +++ b/pluto-interface/lombok.config @@ -2,4 +2,5 @@ lombok.log.fieldName=LOG lombok.log.slf4j.flagUsage = ERROR lombok.log.log4j.flagUsage = ERROR lombok.data.flagUsage = ERROR -lombok.nonNull.exceptionType = IllegalArgumentException \ No newline at end of file +lombok.nonNull.exceptionType = IllegalArgumentException +lombok.addLombokGeneratedAnnotation = true \ No newline at end of file diff --git a/pluto-utils/pom.xml b/pluto-utils/pom.xml index 8f42b0b10e03641afa9f945b9b87cdc9dc43cf7f..ac2602d5a2b26c11cf45ec47d75ca511a0230ac4 100644 --- a/pluto-utils/pom.xml +++ b/pluto-utils/pom.xml @@ -15,8 +15,15 @@ <properties> <pluto.version>0.25.0-SNAPSHOT</pluto.version> - + <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version> + <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version> + + <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version> + <maven-failsafe-plugin.version>3.0.0-M7</maven-failsafe-plugin.version> + <jacoco.plugin.version>0.8.8</jacoco.plugin.version> + + <lombok.version>1.18.24</lombok.version> </properties> <dependencies> @@ -72,6 +79,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> + <version>${maven-jar-plugin.version}</version> <executions> <execution> <goals> @@ -83,6 +91,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> + <version>${maven-compiler-plugin.version}</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> @@ -115,6 +124,60 @@ <generatedSourcesDirectory>target/generated-sources</generatedSourcesDirectory> </configuration> </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>${maven-surefire-plugin.version}</version> + <configuration> + <argLine> + ${surefire.jacoco.args} + </argLine> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>${maven-failsafe-plugin.version}</version> + <configuration> + <argLine> + ${surefire.jacoco.args} + </argLine> + <classesDirectory>${project.build.outputDirectory}</classesDirectory> + </configuration> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.plugin.version}</version> + <executions> + <execution> + <id>start-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <propertyName>surefire.jacoco.args</propertyName> + </configuration> + </execution> + <execution> + <id>generate-report</id> + <phase>package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> </build> </project> \ No newline at end of file diff --git a/pluto-utils/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/pluto-utils/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension new file mode 100644 index 0000000000000000000000000000000000000000..79b126e6cdb86bec1f4f08c205de8961bde1934a --- /dev/null +++ b/pluto-utils/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -0,0 +1 @@ +org.mockito.junit.jupiter.MockitoExtension \ No newline at end of file diff --git a/pluto-utils/src/test/resources/junit-platform.properties b/pluto-utils/src/test/resources/junit-platform.properties new file mode 100644 index 0000000000000000000000000000000000000000..1cebb76d5a58ac034b2627d12411d82d1e85821e --- /dev/null +++ b/pluto-utils/src/test/resources/junit-platform.properties @@ -0,0 +1 @@ +junit.jupiter.extensions.autodetection.enabled = true \ No newline at end of file