Skip to content

Commit d0e01fb

Browse files
authored
Merge pull request #5 from sdeleuze/spring-boot-3.2
2 parents 453fd21 + 6c186af commit d0e01fb

File tree

7 files changed

+57
-27
lines changed

7 files changed

+57
-27
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.idea/
2+
/build/
3+
/target/
4+
/.gradle/
5+
/cr/

.mvn/wrapper/maven-wrapper.jar

61.1 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
# example-spring-boot
22

3-
This is an example of Spring Boot [Getting Started](https://github.com/spring-guides/gs-spring-boot/tree/c42d4edfec8e704431380b884f5cfed78f17e876/initial) modified to work on OpenJDK CRaC.
4-
5-
Changes: https://github.com/CRaC/example-spring-boot/compare/base..crac
3+
This is an example of Spring Boot [Getting Started](https://github.com/spring-guides/gs-spring-boot/tree/main/initial) modified to work on OpenJDK CRaC, which consists only in using Spring Boot 3.2+ and adding the `org.crac:crac` dependency (version `1.4.0` or later).
64

75
## Building
86

9-
Use maven to build
7+
Use Maven to build
108
```
11-
mvn package
9+
./mvnw package
1210
```
1311

1412
## Running
1513

1614
Please refer to [README](https://github.com/CRaC/docs#users-flow) for details.
1715

16+
If you see an error, you may have to update your `criu` permissions with
17+
```
18+
sudo chown root:root $JAVA_HOME/lib/criu
19+
sudo chmod u+s $JAVA_HOME/lib/criu
20+
```
21+
1822
### Preparing the image
1923
1. Run the [JDK](README.md#JDK) in the checkpoint mode
2024
```
21-
$JAVA_HOME/bin/java -XX:CRaCCheckpointTo=cr -jar target/spring-boot-0.0.1-SNAPSHOT.jar
25+
$JAVA_HOME/bin/java -XX:CRaCCheckpointTo=cr -jar target/example-spring-boot-0.0.1-SNAPSHOT.jar
2226
```
2327
2. Warm-up the instance
2428
```
2529
siege -c 1 -r 100000 -b http://localhost:8080
2630
```
2731
3. Request checkpoint
2832
```
29-
jcmd target/spring-boot-0.0.1-SNAPSHOT.jar JDK.checkpoint
33+
jcmd target/example-spring-boot-0.0.1-SNAPSHOT.jar JDK.checkpoint
3034
```
3135

3236
### Restoring

build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
plugins {
2-
id 'org.springframework.boot' version '3.0.0'
3-
id 'io.spring.dependency-management' version '1.1.0'
1+
plugins { id 'org.springframework.boot' version '3.2.0-RC2'
2+
id 'io.spring.dependency-management' version '1.1.3'
43
id 'java'
54
}
65

@@ -10,10 +9,12 @@ sourceCompatibility = '17'
109

1110
repositories {
1211
mavenCentral()
12+
maven { url 'https://repo.spring.io/milestone' }
1313
}
1414

1515
dependencies {
1616
implementation 'org.springframework.boot:spring-boot-starter-web'
17+
implementation 'org.crac:crac:1.4.0'
1718
testImplementation 'org.springframework.boot:spring-boot-starter-test'
1819
}
1920

pom.xml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,26 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.0.0</version>
8+
<version>3.2.0-RC2</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.example</groupId>
12-
<artifactId>spring-boot-initial</artifactId>
12+
<artifactId>example-spring-boot</artifactId>
1313
<version>0.0.1-SNAPSHOT</version>
14-
<name>spring-boot-initial</name>
14+
<name>example-spring-boot</name>
1515
<description>Demo project for Spring Boot</description>
1616
<properties>
1717
<java.version>17</java.version>
18-
<tomcat.version>10.1.7</tomcat.version>
1918
</properties>
2019
<dependencies>
21-
<dependency>
22-
<groupId>io.github.crac.org.apache.tomcat.embed</groupId>
23-
<artifactId>tomcat-embed-core</artifactId>
24-
<version>10.1.7</version>
25-
</dependency>
26-
2720
<dependency>
2821
<groupId>org.springframework.boot</groupId>
2922
<artifactId>spring-boot-starter-web</artifactId>
30-
<exclusions>
31-
<exclusion>
32-
<groupId>org.apache.tomcat.embed</groupId>
33-
<artifactId>tomcat-embed-core</artifactId>
34-
</exclusion>
35-
</exclusions>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.crac</groupId>
26+
<artifactId>crac</artifactId>
27+
<version>1.4.0</version>
3628
</dependency>
3729

3830
<dependency>
@@ -50,5 +42,25 @@
5042
</plugin>
5143
</plugins>
5244
</build>
45+
<repositories>
46+
<repository>
47+
<id>spring-milestones</id>
48+
<name>Spring Milestones</name>
49+
<url>https://repo.spring.io/milestone</url>
50+
<snapshots>
51+
<enabled>false</enabled>
52+
</snapshots>
53+
</repository>
54+
</repositories>
55+
<pluginRepositories>
56+
<pluginRepository>
57+
<id>spring-milestones</id>
58+
<name>Spring Milestones</name>
59+
<url>https://repo.spring.io/milestone</url>
60+
<snapshots>
61+
<enabled>false</enabled>
62+
</snapshots>
63+
</pluginRepository>
64+
</pluginRepositories>
5365

5466
</project>

settings.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
rootProject.name = 'spring-boot'
1+
pluginManagement {
2+
repositories {
3+
maven { url 'https://repo.spring.io/milestone' }
4+
gradlePluginPortal()
5+
}
6+
}
7+
rootProject.name = 'example-spring-boot'

0 commit comments

Comments
 (0)