Skip to content

Commit 1de66d0

Browse files
committed
init auto configuration class
1 parent b872c87 commit 1de66d0

File tree

7 files changed

+78
-160
lines changed

7 files changed

+78
-160
lines changed

pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,33 @@
1616

1717
<name>spring-boot-bean-aggregate</name>
1818

19+
1920
<properties>
2021
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2122
<java.version>1.8</java.version>
2223
<maven.compiler.source>${java.version}</maven.compiler.source>
2324
<maven.compiler.target>${java.version}</maven.compiler.target>
25+
<skipTests>true</skipTests>
2426
</properties>
2527

28+
<parent>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-parent</artifactId>
31+
<version>2.1.1.RELEASE</version>
32+
</parent>
33+
34+
<dependencyManagement>
35+
<dependencies>
36+
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
37+
<dependency>
38+
<groupId>org.projectlombok</groupId>
39+
<artifactId>lombok</artifactId>
40+
<version>1.18.8</version>
41+
<scope>provided</scope>
42+
</dependency>
43+
</dependencies>
44+
</dependencyManagement>
45+
2646
<dependencies>
2747
<dependency>
2848
<groupId>junit</groupId>

spring-boot-bean-aggregate-autoconfigure/pom.xml

Lines changed: 13 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,67 +12,28 @@
1212
<artifactId>spring-boot-bean-aggregate-autoconfigure</artifactId>
1313

1414
<name>spring-boot-bean-aggregate-autoconfigure</name>
15-
<!-- FIXME change it to the project's website -->
16-
<url>http://www.example.com</url>
1715

1816
<properties>
19-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20-
<maven.compiler.source>1.7</maven.compiler.source>
21-
<maven.compiler.target>1.7</maven.compiler.target>
17+
2218
</properties>
2319

2420
<dependencies>
2521
<dependency>
26-
<groupId>junit</groupId>
27-
<artifactId>junit</artifactId>
28-
<version>4.11</version>
29-
<scope>test</scope>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-configuration-processor</artifactId>
24+
<optional>true</optional>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.springframework.boot</groupId>
28+
<artifactId>spring-boot-autoconfigure</artifactId>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.projectlombok</groupId>
32+
<artifactId>lombok</artifactId>
3033
</dependency>
3134
</dependencies>
3235

3336
<build>
34-
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
35-
<plugins>
36-
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
37-
<plugin>
38-
<artifactId>maven-clean-plugin</artifactId>
39-
<version>3.1.0</version>
40-
</plugin>
41-
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
42-
<plugin>
43-
<artifactId>maven-resources-plugin</artifactId>
44-
<version>3.0.2</version>
45-
</plugin>
46-
<plugin>
47-
<artifactId>maven-compiler-plugin</artifactId>
48-
<version>3.8.0</version>
49-
</plugin>
50-
<plugin>
51-
<artifactId>maven-surefire-plugin</artifactId>
52-
<version>2.22.1</version>
53-
</plugin>
54-
<plugin>
55-
<artifactId>maven-jar-plugin</artifactId>
56-
<version>3.0.2</version>
57-
</plugin>
58-
<plugin>
59-
<artifactId>maven-install-plugin</artifactId>
60-
<version>2.5.2</version>
61-
</plugin>
62-
<plugin>
63-
<artifactId>maven-deploy-plugin</artifactId>
64-
<version>2.8.2</version>
65-
</plugin>
66-
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
67-
<plugin>
68-
<artifactId>maven-site-plugin</artifactId>
69-
<version>3.7.1</version>
70-
</plugin>
71-
<plugin>
72-
<artifactId>maven-project-info-reports-plugin</artifactId>
73-
<version>3.0.0</version>
74-
</plugin>
75-
</plugins>
76-
</pluginManagement>
37+
7738
</build>
7839
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.feego.spring.autoconfigure;
2+
3+
import org.springframework.beans.BeansException;
4+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
5+
import org.springframework.context.ApplicationContext;
6+
import org.springframework.context.ApplicationContextAware;
7+
import org.springframework.context.annotation.Configuration;
8+
9+
/**
10+
11+
* @since 2019/5/31 23:28
12+
*/
13+
@Configuration
14+
@EnableConfigurationProperties(BeanAggregateProperties.class)
15+
public class BeanAggregateAutoConfiguration implements ApplicationContextAware {
16+
17+
private ApplicationContext applicationContext;
18+
19+
@Override
20+
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
21+
this.applicationContext = applicationContext;
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.feego.spring.autoconfigure;
2+
3+
import lombok.Data;
4+
import org.springframework.boot.context.properties.ConfigurationProperties;
5+
6+
/**
7+
8+
* @since 2019/5/31 23:50
9+
*/
10+
@ConfigurationProperties(prefix = "org.feego.spring")
11+
@Data
12+
public class BeanAggregateProperties {
13+
String baseBackpages;
14+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2+
org.feego.spring.autoconfigure.BeanAggregateAutoConfiguration

spring-boot-bean-aggregate-core/pom.xml

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,67 +12,16 @@
1212
<artifactId>spring-boot-bean-aggregate-core</artifactId>
1313

1414
<name>spring-boot-bean-aggregate-core</name>
15-
<!-- FIXME change it to the project's website -->
16-
<url>http://www.example.com</url>
1715

1816
<properties>
19-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20-
<maven.compiler.source>1.7</maven.compiler.source>
21-
<maven.compiler.target>1.7</maven.compiler.target>
17+
2218
</properties>
2319

2420
<dependencies>
25-
<dependency>
26-
<groupId>junit</groupId>
27-
<artifactId>junit</artifactId>
28-
<version>4.11</version>
29-
<scope>test</scope>
30-
</dependency>
21+
3122
</dependencies>
3223

3324
<build>
34-
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
35-
<plugins>
36-
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
37-
<plugin>
38-
<artifactId>maven-clean-plugin</artifactId>
39-
<version>3.1.0</version>
40-
</plugin>
41-
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
42-
<plugin>
43-
<artifactId>maven-resources-plugin</artifactId>
44-
<version>3.0.2</version>
45-
</plugin>
46-
<plugin>
47-
<artifactId>maven-compiler-plugin</artifactId>
48-
<version>3.8.0</version>
49-
</plugin>
50-
<plugin>
51-
<artifactId>maven-surefire-plugin</artifactId>
52-
<version>2.22.1</version>
53-
</plugin>
54-
<plugin>
55-
<artifactId>maven-jar-plugin</artifactId>
56-
<version>3.0.2</version>
57-
</plugin>
58-
<plugin>
59-
<artifactId>maven-install-plugin</artifactId>
60-
<version>2.5.2</version>
61-
</plugin>
62-
<plugin>
63-
<artifactId>maven-deploy-plugin</artifactId>
64-
<version>2.8.2</version>
65-
</plugin>
66-
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
67-
<plugin>
68-
<artifactId>maven-site-plugin</artifactId>
69-
<version>3.7.1</version>
70-
</plugin>
71-
<plugin>
72-
<artifactId>maven-project-info-reports-plugin</artifactId>
73-
<version>3.0.0</version>
74-
</plugin>
75-
</plugins>
76-
</pluginManagement>
25+
7726
</build>
7827
</project>

spring-boot-bean-aggregate-example/pom.xml

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,67 +12,16 @@
1212
<artifactId>spring-boot-bean-aggregate-example</artifactId>
1313

1414
<name>spring-boot-bean-aggregate-example</name>
15-
<!-- FIXME change it to the project's website -->
16-
<url>http://www.example.com</url>
1715

1816
<properties>
19-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20-
<maven.compiler.source>1.7</maven.compiler.source>
21-
<maven.compiler.target>1.7</maven.compiler.target>
17+
2218
</properties>
2319

2420
<dependencies>
25-
<dependency>
26-
<groupId>junit</groupId>
27-
<artifactId>junit</artifactId>
28-
<version>4.11</version>
29-
<scope>test</scope>
30-
</dependency>
21+
3122
</dependencies>
3223

3324
<build>
34-
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
35-
<plugins>
36-
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
37-
<plugin>
38-
<artifactId>maven-clean-plugin</artifactId>
39-
<version>3.1.0</version>
40-
</plugin>
41-
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
42-
<plugin>
43-
<artifactId>maven-resources-plugin</artifactId>
44-
<version>3.0.2</version>
45-
</plugin>
46-
<plugin>
47-
<artifactId>maven-compiler-plugin</artifactId>
48-
<version>3.8.0</version>
49-
</plugin>
50-
<plugin>
51-
<artifactId>maven-surefire-plugin</artifactId>
52-
<version>2.22.1</version>
53-
</plugin>
54-
<plugin>
55-
<artifactId>maven-jar-plugin</artifactId>
56-
<version>3.0.2</version>
57-
</plugin>
58-
<plugin>
59-
<artifactId>maven-install-plugin</artifactId>
60-
<version>2.5.2</version>
61-
</plugin>
62-
<plugin>
63-
<artifactId>maven-deploy-plugin</artifactId>
64-
<version>2.8.2</version>
65-
</plugin>
66-
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
67-
<plugin>
68-
<artifactId>maven-site-plugin</artifactId>
69-
<version>3.7.1</version>
70-
</plugin>
71-
<plugin>
72-
<artifactId>maven-project-info-reports-plugin</artifactId>
73-
<version>3.0.0</version>
74-
</plugin>
75-
</plugins>
76-
</pluginManagement>
25+
7726
</build>
7827
</project>

0 commit comments

Comments
 (0)