diff --git a/example-main/pom.xml b/example-main/pom.xml
index ed883ccbdac927faec793371a38d1c11aa03fe5c..510a03223c38b26e41bcfa548e345c7edb4cbc66 100644
--- a/example-main/pom.xml
+++ b/example-main/pom.xml
@@ -16,12 +16,9 @@
1.8
- 3.0.1
-
- 2.5.6
-
3.5.0
2.2
+ 2.0.9
@@ -74,7 +71,12 @@
com.github.xiaoymin
knife4j-spring-boot-starter
- 2.0.7
+ ${knife4j.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter-quartz
@@ -98,6 +100,7 @@
spring-boot-starter-aop
+
org.springframework.boot
spring-boot-starter-test
@@ -115,6 +118,7 @@
main
com.gitee.starblues.example.Application
+ jar
diff --git a/example-main/src/main/java/com/gitee/starblues/example/Application.java b/example-main/src/main/java/com/gitee/starblues/example/Application.java
index 9b46a545b3922a1e6d44c2efa549fc98b87d3509..47d27e998ea1d7d8c940259c99f7a7eb2897d4f4 100644
--- a/example-main/src/main/java/com/gitee/starblues/example/Application.java
+++ b/example-main/src/main/java/com/gitee/starblues/example/Application.java
@@ -19,7 +19,7 @@ public class Application implements SpringBootstrap {
}
@Override
- public void run(String[] args) throws Exception {
+ public void run(String[] args) {
SpringApplication.run(Application.class, args);
}
}
diff --git a/example-main/src/main/resources/mapper/MainUserMapper.xml b/example-main/src/main/resources/mapper/AutowiredTypeDefiner.xml
similarity index 100%
rename from example-main/src/main/resources/mapper/MainUserMapper.xml
rename to example-main/src/main/resources/mapper/AutowiredTypeDefiner.xml
diff --git a/example-plugins-basic/example-basic-1/pom.xml b/example-plugins-basic/example-basic-1/pom.xml
index 8d971c6014db5415ece6fd658e6614340eb46ac5..02b3d8d5ff621eee36faf7c7e5570794f1b482c9 100644
--- a/example-plugins-basic/example-basic-1/pom.xml
+++ b/example-plugins-basic/example-basic-1/pom.xml
@@ -15,7 +15,6 @@
-
com.gitee.starblues
spring-brick-maven-packager
@@ -30,7 +29,7 @@
basic1-config.yaml
- jar
+ jar-outer
diff --git a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/Basic1Plugin.java b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/Basic1Plugin.java
index 86e313b703a79e0f360ffd6e7a7aa51f1020077a..9709ee2a2831272c6eedb2ef7e729e51f34e7582 100644
--- a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/Basic1Plugin.java
+++ b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/Basic1Plugin.java
@@ -3,6 +3,7 @@ package com.gitee.starblues.example.basic1;
import com.gitee.starblues.bootstrap.SpringPluginBootstrap;
import com.gitee.starblues.bootstrap.annotation.DisablePluginWeb;
import com.gitee.starblues.bootstrap.annotation.OneselfConfig;
+import com.gitee.starblues.bootstrap.realize.AutowiredTypeDefiner;
import com.gitee.starblues.example.Application;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration;
@@ -17,10 +18,10 @@ import java.net.URL;
* @since 2021-08-01
*/
@SpringBootApplication
+@OneselfConfig(mainConfigFileName = {"application.yml", "application-dev.yml"})
public class Basic1Plugin extends SpringPluginBootstrap {
public static void main(String[] args) {
new Basic1Plugin().run(Application.class, args);
}
-
}
diff --git a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/CallerController.java b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/CallerController.java
index df35f5b203aef9b19348b195ac43eef1eb4ca4c6..5a62dbb6ac8969fc6f05c519b41b9e5ca3bd8132 100644
--- a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/CallerController.java
+++ b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/CallerController.java
@@ -1,13 +1,17 @@
package com.gitee.starblues.example.basic1.rest;
+import com.gitee.starblues.bootstrap.annotation.AutowiredType;
import com.gitee.starblues.example.basic1.config.BasicConfig;
import com.gitee.starblues.example.basic1.service.ServiceCaller;
import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
+import javax.sql.DataSource;
+import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -25,8 +29,13 @@ public class CallerController {
@Resource
private ServiceCaller serviceCaller;
+ @Autowired
+ @AutowiredType(value = AutowiredType.Type.MAIN)
+ private DataSource dataSource;
+
@GetMapping("/test")
- public BasicConfig caller(){
+ public BasicConfig caller() throws SQLException {
+ System.out.println(dataSource.getConnection().getClientInfo());
String hello = serviceCaller.hello("hello, i am basic");
System.out.println(hello);
return serviceCaller.getConfig("hi, i am basic1");
diff --git a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/MainUserController.java b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/MainUserController.java
index 9ebc02a951a9efccd97b4da64ad83c8b7fa46a68..cea0d4738050e425f3700b722ba1f95131f7b673 100644
--- a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/MainUserController.java
+++ b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/rest/MainUserController.java
@@ -1,5 +1,6 @@
package com.gitee.starblues.example.basic1.rest;
+import com.gitee.starblues.bootstrap.annotation.AutowiredType;
import com.gitee.starblues.example.entity.MainUser;
import com.gitee.starblues.example.service.MainUserService;
import io.swagger.annotations.Api;
@@ -21,6 +22,7 @@ import java.util.List;
public class MainUserController {
@Autowired
+ @AutowiredType(value = AutowiredType.Type.MAIN)
private MainUserService mainUserService;
diff --git a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/service/BasicService.java b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/service/BasicService.java
index 23c63fb3b2dde986d166cfd20aed5efd2e29c90c..1e51eb395572b1f486abc0124cafae58cb7edcc2 100644
--- a/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/service/BasicService.java
+++ b/example-plugins-basic/example-basic-1/src/main/java/com/gitee/starblues/example/basic1/service/BasicService.java
@@ -1,6 +1,8 @@
package com.gitee.starblues.example.basic1.service;
+import com.gitee.starblues.bootstrap.annotation.AutowiredType;
import com.gitee.starblues.core.descriptor.PluginDescriptor;
+import com.gitee.starblues.example.service.MainUserService;
import com.gitee.starblues.example.service.TestAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -11,7 +13,6 @@ import org.springframework.stereotype.Service;
* @version 1.0
* @since 2021-08-01
*/
-@Component
@Service
@TestAnnotation
public class BasicService {
@@ -19,7 +20,12 @@ public class BasicService {
@Autowired
private PluginDescriptor pluginDescriptor;
+ @Autowired
+ @AutowiredType(value = AutowiredType.Type.MAIN)
+ private MainUserService mainUserService;
+
public String getName(){
+ System.out.println(mainUserService.getById(1));
return BasicService.class.getName();
}
diff --git a/example-plugins-basic/example-basic-2/pom.xml b/example-plugins-basic/example-basic-2/pom.xml
index 5536f26cee7933679e8af7950392dedc98933dae..23d80a5fdb73c3e81db366d8407b3d0ae419ee71 100644
--- a/example-plugins-basic/example-basic-2/pom.xml
+++ b/example-plugins-basic/example-basic-2/pom.xml
@@ -14,7 +14,6 @@
-
com.gitee.starblues
spring-brick-maven-packager
diff --git a/example-plugins-basic/pom.xml b/example-plugins-basic/pom.xml
index 90c68bd6b5846860868e2e37f4c97c99852c72c0..068a1da13294118c1b2f401b0be4991826a4ff90 100644
--- a/example-plugins-basic/pom.xml
+++ b/example-plugins-basic/pom.xml
@@ -18,12 +18,9 @@
example-basic-2
- 1.18.10
+ 1.18.24
4.13
- 2.5.6
- 3.0.1
-
3.1.1
diff --git a/example-plugins-cloud/pom.xml b/example-plugins-cloud/pom.xml
index 5f9de1e254e62a0af0c397c0cb1b615608988ab0..6cf7a4556be11d7d840145b35a87a742c9c7f30d 100644
--- a/example-plugins-cloud/pom.xml
+++ b/example-plugins-cloud/pom.xml
@@ -17,11 +17,10 @@
- 1.18.10
+ 1.18.24
4.13
2.3.12.RELEASE
- 3.0.1
3.1.1
diff --git a/example-plugins-db/example-jpa/pom.xml b/example-plugins-db/example-jpa/pom.xml
index 7bb05090c6169c7960184f1d45143f77f680cde3..211433fdb977b2f4d4c5ca9825457ae25d8371ec 100644
--- a/example-plugins-db/example-jpa/pom.xml
+++ b/example-plugins-db/example-jpa/pom.xml
@@ -18,12 +18,12 @@
org.springframework.boot
spring-boot-starter-quartz
- 2.5.0
+ ${spring-boot.version}
org.springframework.boot
spring-boot-starter-data-jpa
- 2.5.0
+ ${spring-boot.version}
diff --git a/example-plugins-db/example-mybatis-plus/src/main/java/com/gitee/starblues/example/mp/config/Config.java b/example-plugins-db/example-mybatis-plus/src/main/java/com/gitee/starblues/example/mp/config/Config.java
index 72d94dbbed7b2ffd430c368bdb9080724625a9d0..b267f4a08ba0903868daa225a10e65c4e84c633e 100644
--- a/example-plugins-db/example-mybatis-plus/src/main/java/com/gitee/starblues/example/mp/config/Config.java
+++ b/example-plugins-db/example-mybatis-plus/src/main/java/com/gitee/starblues/example/mp/config/Config.java
@@ -1,6 +1,7 @@
package com.gitee.starblues.example.mp.config;
-import com.gitee.starblues.bootstrap.realize.MainEnvironmentProvider;
+import com.gitee.starblues.bootstrap.PluginContextHolder;
+import com.gitee.starblues.spring.environment.EnvironmentProvider;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.context.annotation.Bean;
@@ -14,7 +15,8 @@ import org.springframework.context.annotation.Configuration;
public class Config {
@Bean
- public HikariDataSource dataSource(MainEnvironmentProvider environmentProvider){
+ public HikariDataSource dataSource(){
+ EnvironmentProvider environmentProvider = PluginContextHolder.getEnvironmentProvider();
// 从主程序获取配置
String url = environmentProvider.getString("spring.datasource.url");
String username = environmentProvider.getString("spring.datasource.username");
diff --git a/example-plugins-db/pom.xml b/example-plugins-db/pom.xml
index 73038bd1689150d28483bc13bf3eb27195aecb4f..7a858733bb9d7085edf32807a5e3aefb1b060a4d 100644
--- a/example-plugins-db/pom.xml
+++ b/example-plugins-db/pom.xml
@@ -18,12 +18,9 @@
example-mybatis-plus
- 1.18.10
+ 1.18.24
4.13
- 3.0.1
- 2.5.6
-
3.1.1
diff --git a/pom.xml b/pom.xml
index 10795272f536e126b9eb2f07f87bb88790601664..37cb55da96f5a2ae391c39fac621eaba343772ce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,6 +10,9 @@
1.8
+
+ 3.0.3
+ 2.5.6