Skip to content

Commit 8877f30

Browse files
committed
upgraded to Java 11 and fixed build
1 parent b0ae545 commit 8877f30

58 files changed

Lines changed: 178 additions & 162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/libraries/Gradle__org_springframework_boot_spring_boot_starter_validation_2_1_3_RELEASE.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/spring-boot-testing.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ script: ./gradlew clean build --info
1414
language: java
1515

1616
jdk:
17-
- oraclejdk8
17+
- oraclejdk11

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,33 @@
22

33
[![Travis CI Status](https://travis-ci.org/thombergs/code-examples.svg?branch=master)](https://travis-ci.org/thombergs/code-examples)
44

5-
This repo contains example projects which show how to use different java technologies.
5+
This repo contains example projects which show how to use different (not only) Java technologies.
66
The examples are usually accompanied by a blog post on [https://reflectoring.io](https://reflectoring.io).
77

8-
See the READMEs in each subdirectory of this repo for more information.
8+
See the READMEs in each subdirectory of this repo for more information.
9+
10+
# Java
11+
All modules require **Java 11** to compile and run.
12+
13+
# Building with Gradle
14+
15+
The build is configured so that you can build all modules at once or each module separately.
16+
17+
## Building all Modules at Once
18+
19+
In the main folder, run
20+
```
21+
./gradlew clean build
22+
```
23+
24+
## Building a Module Separately
25+
26+
In the folder of the module, run
27+
28+
```
29+
./gradlew clean build
30+
```
31+
32+
## Non-Java Modules
33+
34+
Some folders contain non-Java projects. For those, refer to the README within the module folder.

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tasks.withType(JavaCompile) {
2+
options.fork = true;
3+
}

junit/assumptions/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
apply plugin: 'java'
88

99
version = '0.0.1-SNAPSHOT'
10-
sourceCompatibility = 1.8
10+
sourceCompatibility = 11
1111

1212
repositories {
1313
mavenLocal()

pact/pact-feign-consumer/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ dependencies {
3535
compile('org.springframework.cloud:spring-cloud-starter-openfeign')
3636
compile('org.springframework.cloud:spring-cloud-starter-netflix-ribbon')
3737
compile('com.h2database:h2:1.4.196')
38+
39+
// add jaxb since it's no longer available in Java 11
40+
runtime('javax.xml.bind:jaxb-api:2.3.1')
41+
42+
// add javassist >= 3.23.1-GA since earlier versions are broken in Java 11
43+
// see https://github.com/jboss-javassist/javassist/issues/194
44+
runtime('org.javassist:javassist:3.23.1-GA')
45+
3846
testCompile('org.codehaus.groovy:groovy-all:2.4.6')
3947
testCompile("au.com.dius:pact-jvm-consumer-junit5_2.12:${pact_version}")
4048
testCompile('org.springframework.boot:spring-boot-starter-test')

pact/pact-feign-consumer/src/test/java/io/reflectoring/UserServiceConsumerTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class UserServiceConsumerTest {
2727
@Autowired
2828
private UserClient userClient;
2929

30-
@Autowired
31-
private RestTemplate restTemplate;
32-
3330
@Pact(state = "provider accepts a new person", provider = "userservice", consumer = "userclient")
3431
RequestResponsePact createPersonPact(PactDslWithProvider builder) {
3532

pact/pact-message-consumer/build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ apply plugin: 'org.springframework.boot'
1313
apply plugin: 'io.spring.dependency-management'
1414

1515
version = '0.0.1-SNAPSHOT'
16-
sourceCompatibility = 1.8
16+
sourceCompatibility = 11
1717

1818
repositories {
1919
mavenLocal()
@@ -25,6 +25,14 @@ dependencies {
2525
compile('org.springframework.boot:spring-boot-starter-amqp')
2626
compile('com.h2database:h2:1.4.196')
2727
compileOnly('org.projectlombok:lombok:1.18.2')
28+
29+
// add jaxb since it's no longer available in Java 11
30+
runtime('javax.xml.bind:jaxb-api:2.3.1')
31+
32+
// add javassist >= 3.23.1-GA since earlier versions are broken in Java 11
33+
// see https://github.com/jboss-javassist/javassist/issues/194
34+
runtime('org.javassist:javassist:3.23.1-GA')
35+
2836
testCompile("au.com.dius:pact-jvm-consumer-junit_2.12:${pact_version}")
2937
testCompile("au.com.dius:pact-jvm-consumer-groovy_2.12:${pact_version}")
3038
testCompile('org.springframework.boot:spring-boot-starter-test')

pact/pact-message-consumer/target/pacts/userclient-userservice.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"contents": {
1515
"messageUuid": "string",
1616
"user": {
17-
"name": "Zaphod Beeblebrox",
18-
"id": 42
17+
"id": 42,
18+
"name": "Zaphod Beeblebrox"
1919
}
2020
},
2121
"matchingRules": {

0 commit comments

Comments
 (0)