Skip to content

Commit b4d4d4e

Browse files
committed
upgrade spring-boot project, extract auto-config, remove security
1 parent c0131fd commit b4d4d4e

63 files changed

Lines changed: 321 additions & 369 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.

‎pom.xml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
<modules>
1212
<module>parent-boot-5</module>
13-
<module>parent-spring</module>
14-
<module>parent-java</module>
13+
<module>parent-boot-2</module>
14+
<module>parent-spring</module>
15+
<module>parent-java</module>
1516
<module>asm</module>
1617
<module>atomix</module>
1718
<module>apache-cayenne</module>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/target/
2+
.settings/
3+
.classpath
4+
.project
5+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The Course
2+
The "REST With Spring" Classes: http://bit.ly/restwithspring
3+
4+
### Relevant Articles:
5+
6+
- [Create a Custom Auto-Configuration with Spring Boot](http://www.baeldung.com/spring-boot-custom-auto-configuration)
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>spring-boot-autoconfiguration</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<packaging>war</packaging>
8+
<name>spring-boot-auto-configuration</name>
9+
<description>This is simple boot application demonstrating a custom auto-configuration</description>
10+
11+
<parent>
12+
<artifactId>parent-boot-2</artifactId>
13+
<groupId>com.baeldung</groupId>
14+
<version>0.0.1-SNAPSHOT</version>
15+
<relativePath>../parent-boot-2</relativePath>
16+
</parent>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.springframework.boot</groupId>
25+
<artifactId>spring-boot-starter-web</artifactId>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-starter-data-jpa</artifactId>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter-test</artifactId>
34+
<scope>test</scope>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>mysql</groupId>
39+
<artifactId>mysql-connector-java</artifactId>
40+
<version>8.0.11</version>
41+
</dependency>
42+
</dependencies>
43+
44+
<build>
45+
<finalName>spring-boot</finalName>
46+
<resources>
47+
<resource>
48+
<directory>src/main/resources</directory>
49+
<filtering>true</filtering>
50+
</resource>
51+
</resources>
52+
53+
<plugins>
54+
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-war-plugin</artifactId>
58+
</plugin>
59+
60+
</plugins>
61+
62+
</build>
63+
64+
<profiles>
65+
<profile>
66+
<id>autoconfiguration</id>
67+
<build>
68+
<plugins>
69+
<plugin>
70+
<groupId>org.apache.maven.plugins</groupId>
71+
<artifactId>maven-surefire-plugin</artifactId>
72+
<executions>
73+
<execution>
74+
<phase>integration-test</phase>
75+
<goals>
76+
<goal>test</goal>
77+
</goals>
78+
<configuration>
79+
<excludes>
80+
<exclude>**/*LiveTest.java</exclude>
81+
<exclude>**/*IntegrationTest.java</exclude>
82+
</excludes>
83+
<includes>
84+
<include>**/AutoconfigurationTest.java</include>
85+
</includes>
86+
</configuration>
87+
</execution>
88+
</executions>
89+
<configuration>
90+
<systemPropertyVariables>
91+
<test.mime>json</test.mime>
92+
</systemPropertyVariables>
93+
</configuration>
94+
</plugin>
95+
</plugins>
96+
</build>
97+
</profile>
98+
</profiles>
99+
100+
101+
<properties>
102+
<jquery.version>3.1.1</jquery.version>
103+
<bootstrap.version>3.3.7-1</bootstrap.version>
104+
<subethasmtp.version>3.1.7</subethasmtp.version>
105+
<tomee-servlet-api.version>8.5.11</tomee-servlet-api.version>
106+
</properties>
107+
108+
</project>

spring-boot/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java renamed to spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/MySQLAutoconfiguration.java

File renamed without changes.

spring-boot/src/main/java/com/baeldung/autoconfiguration/example/AutoconfigurationApplication.java renamed to spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/AutoconfigurationApplication.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package com.baeldung.autoconfiguration.example;
22

3-
import javax.annotation.security.RolesAllowed;
4-
53
import org.springframework.boot.SpringApplication;
64
import org.springframework.boot.autoconfigure.SpringBootApplication;
75

86
@SpringBootApplication
97
public class AutoconfigurationApplication {
10-
@RolesAllowed("*")
8+
119
public static void main(String[] args) {
12-
System.setProperty("security.basic.enabled", "false");
1310
SpringApplication.run(AutoconfigurationApplication.class, args);
1411
}
1512
}

spring-boot/src/main/java/com/baeldung/autoconfiguration/example/MyUser.java renamed to spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUser.java

File renamed without changes.

spring-boot/src/main/java/com/baeldung/autoconfiguration/example/MyUserRepository.java renamed to spring-boot-autoconfiguration/src/main/java/com/baeldung/autoconfiguration/example/MyUserRepository.java

File renamed without changes.

spring-boot/src/main/resources/META-INF/spring.factories renamed to spring-boot-autoconfiguration/src/main/resources/META-INF/spring.factories

File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
server.port=9090
2+
3+
spring.jpa.show-sql=true
4+
spring.jpa.hibernate.ddl-auto = update

0 commit comments

Comments
 (0)