Skip to content

Commit

Permalink
Update dependency org.springframework.boot:spring-boot-starter-parent…
Browse files Browse the repository at this point in the history
… to v3.1.1 (#110)

* Update dependency org.springframework.boot:spring-boot-starter-parent to v3.1.1

* upgrade

* polish

* polish

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Raja Kolli <[email protected]>
  • Loading branch information
renovate[bot] and rajadilipkolli authored Jul 16, 2023
1 parent 025af9c commit eee74d7
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 47 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/springboot2-jpa-swagger3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,19 @@ jobs:
build:
name: Run Unit & Integration Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: springboot2-jpa-swagger3
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 18
- name: Set up JDK 20
uses: actions/[email protected]
with:
java-version: 18
java-version: 20
distribution: "zulu"
cache: "maven"
- name: Start up databases via docker compose
run: |
cd springboot2-jpa-swagger3
docker compose up -d
sleep 15
docker ps -a
- name: Build and analyze
run: |
cd springboot2-jpa-swagger3
mvn clean package
run: ./mvnw clean package
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@
"projectName": "org.springframework-springboot-stomp-websocket",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-Springboot2Swagger3Application<net.guides.springboot2-springboot2-jpa-swagger3>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "net.guides.springboot2.springboot2swagger3.Springboot2Swagger3Application",
"projectName": "net.guides.springboot2-springboot2-jpa-swagger3",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-SpringbootThymeleafSecurityDemoApplication<com.apress-springboot-thymeleaf-security-demo>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "net.javaguides.springbootsecurity.SpringbootThymeleafSecurityDemoApplication",
"projectName": "com.apress-springboot-thymeleaf-security-demo",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]
}
44 changes: 31 additions & 13 deletions springboot-thymeleaf-security-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.8</version>
<version>3.1.1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand All @@ -23,6 +23,10 @@
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand All @@ -48,33 +52,47 @@
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<scope>provided</scope>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
################### DataSource Configuration ##########################
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=root

spring.sql.init.mode=always
spring.jpa.open-in-view=false

################### Hibernate Configuration ##########################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ delete from users;
INSERT INTO roles (id, name) VALUES
(1, 'ROLE_ADMIN'),
(2, 'ROLE_ACTUATOR'),
(3, 'ROLE_USER')
;
(3, 'ROLE_USER');

INSERT INTO users (id, email, password, name) VALUES
(1, '[email protected]', '$2a$10$hKDVYxLefVHV/vtuPhWD3OigtRyOykRLDdUAp80Z1crSoS1lFqaFS', 'Admin'),
Expand All @@ -52,5 +51,4 @@ insert into user_role(user_id, role_id) values
(1,1),
(1,2),
(1,3),
(3,2)
;
(3,2);
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
@SpringBootTest(classes = TestSpringbootThymeleafSecurityDemoApplication.class)
class SpringbootThymeleafSecurityDemoApplicationTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package net.javaguides.springbootsecurity;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.MySQLContainer;

@TestConfiguration(proxyBeanMethods = false)
public class TestSpringbootThymeleafSecurityDemoApplication {

@Bean
@ServiceConnection
MySQLContainer<?> mysqlContainer() {
return new MySQLContainer<>("mysql:latest");
}

public static void main(String[] args) {
SpringApplication.from(SpringbootThymeleafSecurityDemoApplication::main).with(TestSpringbootThymeleafSecurityDemoApplication.class).run(args);
}

}
39 changes: 30 additions & 9 deletions springboot2-jpa-swagger3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.8</version>
<version>3.1.1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

Expand All @@ -26,35 +26,56 @@
</properties>

<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Swagger -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.7.0</version>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.1.0</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spring.datasource.password=postgres

# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
spring.jpa.open-in-view=false

logging.level.root = INFO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
@SpringBootTest(classes = TestSpringboot2Swagger3Application.class)
class Springboot2Swagger2ApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package net.guides.springboot2.springboot2swagger3;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;

@TestConfiguration(proxyBeanMethods = false)
public class TestSpringboot2Swagger3Application {

@Bean
@ServiceConnection
PostgreSQLContainer<?> postgresContainer() {
return new PostgreSQLContainer<>("postgres:latest");
}

public static void main(String[] args) {
SpringApplication.from(Springboot2Swagger3Application::main).with(TestSpringboot2Swagger3Application.class).run(args);
}

}

0 comments on commit eee74d7

Please sign in to comment.