Skip to content

Commit fc042b9

Browse files
julian-eggersSven Illgen
authored and
Sven Illgen
committed
LIBS-396 JDK11 & SpringBoot 2.1 & Build improved (#6)
1 parent 78ed1af commit fc042b9

File tree

7 files changed

+116
-52
lines changed

7 files changed

+116
-52
lines changed

.travis.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ language: java
77

88
jdk:
99
- oraclejdk8
10+
- oraclejdk11
1011

1112
cache:
1213
directories:
1314
- $HOME/.m2
1415

16+
install: mvn verify -Dgpg.skip=true
17+
1518
before_install:
16-
- wget -O ~/codacy-coverage-reporter-assembly.jar https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.0/codacy-coverage-reporter-4.0.0-assembly.jar
17-
18-
install:
19-
- mvn clean compile
19+
- wget -O ~/codacy-coverage-reporter-assembly.jar https://github.com/codacy/codacy-coverage-reporter/releases/download/4.0.5/codacy-coverage-reporter-4.0.5-assembly.jar
2020

21-
script:
22-
- mvn verify -Dgpg.skip=true
23-
2421
after_success:
25-
- mvn coveralls:report
2622
- java -jar ~/codacy-coverage-reporter-assembly.jar report -l Java -r target/site/jacoco/jacoco.xml

Jenkinsfile

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
pipeline
1+
pipeline
22
{
33
agent any
44

5+
environment
6+
{
7+
deploymentBranch = "master"
8+
mavenExecutable = "mvn-jdk8"
9+
}
10+
511
triggers
612
{
713
cron('H H(0-5) * * *')
@@ -22,42 +28,56 @@ pipeline
2228
{
2329
steps
2430
{
25-
sh 'mvn clean compile test-compile'
31+
sh '${mavenExecutable} clean compile test-compile'
2632
}
2733
}
28-
34+
2935
stage('Unit-Tests')
3036
{
3137
steps
3238
{
33-
sh 'mvn surefire:test'
39+
sh '${mavenExecutable} surefire:test'
3440
}
3541
}
36-
42+
3743
stage('Integration-Tests')
3844
{
45+
when { branch "${env.deploymentBranch}" }
46+
3947
steps
4048
{
41-
sh 'mvn failsafe:integration-test failsafe:verify'
49+
sh '${mavenExecutable} failsafe:integration-test failsafe:verify'
4250
}
4351
}
44-
52+
4553
stage('Release')
4654
{
47-
when { branch "master" }
48-
55+
when { branch "${env.deploymentBranch}" }
56+
4957
steps
5058
{
51-
sh 'mvn clean deploy -Dmaven.test.skip=true'
59+
sh '${mavenExecutable} clean deploy -Dmaven.test.skip=true'
5260
}
5361
}
54-
62+
5563
stage('SonarQube')
5664
{
65+
when { branch "${env.deploymentBranch}" }
66+
5767
steps
5868
{
59-
sh 'mvn clean verify sonar:sonar -Dsonar.host.url=http://sonarqube.avidesmedia/'
69+
sh '${mavenExecutable} clean verify sonar:sonar -Dsonar.host.url=http://sonarqube.avidesmedia/'
6070
}
61-
}
71+
}
72+
73+
stage('POM-Analysis')
74+
{
75+
when { branch "${env.deploymentBranch}" }
76+
77+
steps
78+
{
79+
sh '${mavenExecutable} enforcer:enforce'
80+
}
81+
}
6282
}
6383
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ springboot-testcontainer-mongodb
22
================================
33

44
[![Maven Central](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/com/avides/springboot/testcontainer/springboot-testcontainer-mongodb/maven-metadata.xml.svg)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.avides.springboot.testcontainer%22%20AND%20a%3A%22springboot-testcontainer-mongodb%22)
5-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5e0661e8bfe04eb28e66015aa0611483)](https://www.codacy.com/app/avides-builds/springboot-testcontainer-mongodb?utm_source=github.com&utm_medium=referral&utm_content=springboot-testcontainer/springboot-testcontainer-mongodb&utm_campaign=Badge_Grade)
6-
[![Coverage Status](https://coveralls.io/repos/springboot-testcontainer/springboot-testcontainer-mongodb/badge.svg)](https://coveralls.io/r/springboot-testcontainer/springboot-testcontainer-mongodb)
5+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5e0661e8bfe04eb28e66015aa0611483)](https://www.codacy.com/app/avides-builds/springboot-testcontainer-mongodb)
6+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/5e0661e8bfe04eb28e66015aa0611483)](https://www.codacy.com/app/avides-builds/springboot-testcontainer-mongodb)
77
[![Build Status](https://travis-ci.org/springboot-testcontainer/springboot-testcontainer-mongodb.svg?branch=master)](https://travis-ci.org/springboot-testcontainer/springboot-testcontainer-mongodb)
88

99
### Dependency
1010
```xml
1111
<dependency>
1212
<groupId>com.avides.springboot.testcontainer</groupId>
1313
<artifactId>springboot-testcontainer-mongodb</artifactId>
14-
<version>0.1.0-RC5</version>
14+
<version>0.1.0-RC6</version>
1515
<scope>test</scope>
1616
</dependency>
1717
```
@@ -20,7 +20,7 @@ springboot-testcontainer-mongodb
2020
Properties consumed (in `bootstrap.properties`):
2121
- `embedded.container.mongodb.enabled` (default is `true`)
2222
- `embedded.container.mongodb.startup-timeout` (default is `30`)
23-
- `embedded.container.mongodb.docker-image` (default is `mongo:3.4.15`)
23+
- `embedded.container.mongodb.docker-image` (default is `mongo:3.4.18`)
2424
- `embedded.container.mongodb.port` (default is `27017`)
2525

2626
Properties provided (in `application-it.properties`):

pom.xml

Lines changed: 72 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>springboot-testcontainer-mongodb</name>
66
<description>MongoDB test-container</description>
77
<url>https://github.com/springboot-testcontainer/springboot-testcontainer-mongodb</url>
8-
<version>0.1.0-RC5</version>
8+
<version>0.1.0-RC6</version>
99

1010
<properties>
1111
<!-- System -->
@@ -14,24 +14,23 @@
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<java.version>1.8</java.version>
1616
<!-- Testing -->
17-
<jacoco.version>0.8.1</jacoco.version>
18-
<powermock.version>1.7.3</powermock.version>
19-
<easymock.version>3.6</easymock.version>
17+
<jacoco.version>0.8.2</jacoco.version>
18+
<powermock.version>2.0.0-RC.3</powermock.version>
19+
<easymock.version>4.0.1</easymock.version>
2020
<!-- Build -->
21-
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
21+
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
2222
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
2323
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
2424
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
25-
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
26-
<maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
27-
<coveralls.version>4.3.0</coveralls.version>
25+
<maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
26+
<maven-failsafe-plugin.version>2.22.1</maven-failsafe-plugin.version>
2827
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
29-
<maven-scm-provider-gitexe.version>1.10.0</maven-scm-provider-gitexe.version>
30-
<github-release-plugin.version>1.2.0</github-release-plugin.version>
28+
<maven-scm-provider-gitexe.version>1.11.1</maven-scm-provider-gitexe.version>
29+
<github-release-plugin.version>1.3.0</github-release-plugin.version>
3130
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
32-
<!-- Other -->
33-
<spring.version>5.0.7.RELEASE</spring.version>
34-
<spring-boot.version>2.0.3.RELEASE</spring-boot.version>
31+
<!-- Spring -->
32+
<spring.version>5.0.10.RELEASE</spring.version>
33+
<spring-boot.version>2.0.6.RELEASE</spring-boot.version>
3534
</properties>
3635

3736
<repositories>
@@ -46,32 +45,32 @@
4645
<dependency>
4746
<groupId>org.projectlombok</groupId>
4847
<artifactId>lombok</artifactId>
49-
<version>1.18.0</version>
48+
<version>1.18.4</version>
5049
<scope>provided</scope>
5150
</dependency>
5251
<dependency>
5352
<groupId>com.avides.springboot.testcontainer</groupId>
5453
<artifactId>springboot-testcontainer-common</artifactId>
55-
<version>0.1.0-RC6</version>
54+
<version>0.1.0-RC10</version>
5655
</dependency>
5756
<dependency>
5857
<groupId>org.springframework.boot</groupId>
59-
<artifactId>spring-boot-configuration-processor</artifactId>
58+
<artifactId>spring-boot-autoconfigure</artifactId>
6059
<version>${spring-boot.version}</version>
61-
<optional>true</optional>
60+
<scope>provided</scope>
6261
</dependency>
6362
<dependency>
6463
<groupId>org.springframework.data</groupId>
6564
<artifactId>spring-data-mongodb</artifactId>
66-
<version>2.0.8.RELEASE</version>
65+
<version>2.0.11.RELEASE</version>
6766
<scope>provided</scope>
6867
</dependency>
6968

7069
<!-- Testing -->
7170
<dependency>
7271
<groupId>org.assertj</groupId>
7372
<artifactId>assertj-core</artifactId>
74-
<version>3.10.0</version>
73+
<version>3.11.1</version>
7574
<scope>test</scope>
7675
</dependency>
7776
<dependency>
@@ -219,6 +218,16 @@
219218
</execution>
220219
</executions>
221220
</plugin>
221+
<plugin>
222+
<groupId>org.apache.maven.plugins</groupId>
223+
<artifactId>maven-enforcer-plugin</artifactId>
224+
<configuration>
225+
<rules>
226+
<dependencyConvergence />
227+
</rules>
228+
<fail>false</fail>
229+
</configuration>
230+
</plugin>
222231
<plugin>
223232
<groupId>org.jacoco</groupId>
224233
<artifactId>jacoco-maven-plugin</artifactId>
@@ -242,20 +251,59 @@
242251
<goals>
243252
<goal>report</goal>
244253
</goals>
254+
<configuration>
255+
<dataFile>target/jacoco-ut.exec</dataFile>
256+
<outputDirectory>target/jacoco-ut</outputDirectory>
257+
</configuration>
258+
</execution>
259+
<execution>
260+
<id>integration-test-report</id>
261+
<phase>post-integration-test</phase>
262+
<goals>
263+
<goal>report</goal>
264+
</goals>
265+
<configuration>
266+
<dataFile>target/jacoco-it.exec</dataFile>
267+
<outputDirectory>target/jacoco-it</outputDirectory>
268+
</configuration>
245269
</execution>
246270
<execution>
247271
<id>agent</id>
248272
<goals>
249273
<goal>prepare-agent</goal>
250274
</goals>
251275
</execution>
276+
<execution>
277+
<id>merge-results</id>
278+
<phase>verify</phase>
279+
<goals>
280+
<goal>merge</goal>
281+
</goals>
282+
<configuration>
283+
<fileSets>
284+
<fileSet>
285+
<directory>target</directory>
286+
<includes>
287+
<include>*.exec</include>
288+
</includes>
289+
</fileSet>
290+
</fileSets>
291+
<destFile>target/jacoco.exec</destFile>
292+
</configuration>
293+
</execution>
294+
<execution>
295+
<id>post-merge-report</id>
296+
<phase>verify</phase>
297+
<goals>
298+
<goal>report</goal>
299+
</goals>
300+
<configuration>
301+
<dataFile>target/jacoco.exec</dataFile>
302+
<outputDirectory>target/site/jacoco</outputDirectory>
303+
</configuration>
304+
</execution>
252305
</executions>
253306
</plugin>
254-
<plugin>
255-
<groupId>org.eluder.coveralls</groupId>
256-
<artifactId>coveralls-maven-plugin</artifactId>
257-
<version>${coveralls.version}</version>
258-
</plugin>
259307
<!-- DEPLOYMENT -->
260308
<plugin>
261309
<artifactId>maven-release-plugin</artifactId>

src/main/java/com/avides/springboot/testcontainer/mongodb/MongodbProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public class MongodbProperties extends AbstractEmbeddedContainerProperties
2020

2121
public MongodbProperties()
2222
{
23-
setDockerImage("mongo:3.4.15");
23+
setDockerImage("mongo:3.4.18");
2424
}
2525
}

src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"name": "embedded.container.mongodb.docker-image",
1818
"type": "java.lang.String",
1919
"description": "Docker-image",
20-
"defaultValue": "mongo:3.4.15"
20+
"defaultValue": "mongo:3.4.18"
2121
},
2222
{
2323
"name": "embedded.container.mongodb.port",

src/test/java/com/avides/springboot/testcontainer/mongodb/MongodbPropertiesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public void testDefaults()
1313
MongodbProperties properties = new MongodbProperties();
1414
assertTrue(properties.isEnabled());
1515
assertEquals(30, properties.getStartupTimeout());
16-
assertEquals("mongo:3.4.15", properties.getDockerImage());
16+
assertEquals("mongo:3.4.18", properties.getDockerImage());
1717

1818
assertEquals(27017, properties.getPort());
1919
}

0 commit comments

Comments
 (0)