Skip to content

Commit 3dc0c80

Browse files
committed
Merge branch '2.3.x'
2 parents 12745ef + c0abcf9 commit 3dc0c80

File tree

20 files changed

+361
-111
lines changed

20 files changed

+361
-111
lines changed

CHANGELOG.md

+30
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
## v2.3.2(2020-10-09)
2+
- 升级使用Message Pipe版本为v1.0.3
3+
- 修改Message Client示例项目支持新版本变动
4+
- 修改Banner输出内容以及样式
5+
- 新增MessagePipeConfiguration配置类的Customizer接口
6+
- 修复Ci自动构建时遇到的错误问题
7+
- 修复mybatis enhance plugin无法找到版本问题
8+
- 添加消息管道需要的默认RedisMessageListenerContainer
9+
- 配置RedisMessageListenerContainer类作为实例化消息管道配置条件
10+
- 适配使用默认的RedisMessageListenerContainer
11+
- 删除JsonTools,请使用JsonUtils
12+
- 升级Spring/SpringBoot版本为v5.2.9/v2.3.4
13+
- 修改pageable属性类转换方式
14+
- 独立Oauth客户端配置信息
15+
16+
## v2.3.1(2020-8-24)
17+
- 修复Security排除路径集合问题
18+
- 新增自定义LoggingFactoryBean接口集合类LoggingFactoryBeanCustomizers
19+
- 修改部分类注释
20+
- 集成GitHub Actions
21+
- 排除默认的数据源(HikariCP)
22+
- 删除项目的Maven Central配置路径列表
23+
- 升级SpringBoot版本为v2.3.3
24+
- 修改MongoAutoConfiguration自动化配置类条件
25+
- 默认启用配置@EnableLoggingClient/@EnableLoggingAdmin注解
26+
- 配置GitHub Actions缓存
27+
- 升级Spring版本为v5.2.8
28+
- 升级minbox-bom版本为v1.0.1
29+
- 整合message-pipe顺序消息管道
30+
131
## v2.3.0(2020-07-21)
232

333
- 变更项目根模块的 "artifactId" 为 "api-boot-build"

api-boot-project/api-boot-autoconfigure/pom.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<dependency>
5050
<groupId>org.springframework.cloud</groupId>
5151
<artifactId>spring-cloud-starter-openfeign</artifactId>
52+
<version>${spring-cloud.version}</version>
5253
<optional>true</optional>
5354
</dependency>
5455

@@ -176,7 +177,11 @@
176177
<artifactId>message-pipe-spring-context</artifactId>
177178
<optional>true</optional>
178179
</dependency>
179-
180+
<dependency>
181+
<groupId>org.minbox.framework</groupId>
182+
<artifactId>ssh-agent</artifactId>
183+
<optional>true</optional>
184+
</dependency>
180185

181186
<!--Others-->
182187
<dependency>
@@ -260,6 +265,7 @@
260265
<artifactId>guava</artifactId>
261266
<optional>true</optional>
262267
</dependency>
268+
263269
</dependencies>
264270
<build>
265271
<resources>

api-boot-project/api-boot-autoconfigure/src/main/java/org/minbox/framework/api/boot/autoconfigure/message/pipe/server/MessagePipeServerAutoConfiguration.java

+20-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,33 @@ public MessagePipeServerAutoConfiguration(MessagePipeServerProperties messagePip
2727
this.messagePipeServerProperties = messagePipeServerProperties;
2828
}
2929

30+
/**
31+
* Instantiate the wrapper class of {@link ServerConfigurationCustomizer}
32+
*
33+
* @param customizers The {@link ServerConfigurationCustomizer} object provider
34+
* @return The {@link ServerConfigurationCustomizers} instance
35+
*/
36+
@Bean
37+
@ConditionalOnMissingBean
38+
public ServerConfigurationCustomizers serverConfigurationCustomizers(
39+
ObjectProvider<ServerConfigurationCustomizer> customizers) {
40+
List<ServerConfigurationCustomizer> sortedCustomizers =
41+
customizers.orderedStream().collect(Collectors.toList());
42+
return new ServerConfigurationCustomizers(sortedCustomizers);
43+
}
44+
3045
/**
3146
* Create {@link ServerConfiguration} instance
3247
*
3348
* @return The {@link ServerConfiguration} instance
3449
* @see MessagePipeServerProperties
50+
* @see ServerConfigurationCustomizer
51+
* @see ServerConfigurationCustomizers
3552
*/
3653
@Bean
37-
public ServerConfiguration serverConfiguration() {
38-
return messagePipeServerProperties.getConfiguration();
54+
public ServerConfiguration serverConfiguration(ServerConfigurationCustomizers customizers) {
55+
ServerConfiguration configuration = messagePipeServerProperties.getConfiguration();
56+
return customizers.customizer(configuration);
3957
}
4058

4159
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.minbox.framework.api.boot.autoconfigure.message.pipe.server;
2+
3+
import org.minbox.framework.message.pipe.server.config.ServerConfiguration;
4+
5+
/**
6+
* @author 恒宇少年
7+
*/
8+
@FunctionalInterface
9+
public interface ServerConfigurationCustomizer {
10+
void customize(ServerConfiguration serverConfiguration);
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.minbox.framework.api.boot.autoconfigure.message.pipe.server;
2+
3+
import org.minbox.framework.message.pipe.server.config.ServerConfiguration;
4+
import org.springframework.boot.util.LambdaSafe;
5+
6+
import java.util.ArrayList;
7+
import java.util.Collections;
8+
import java.util.List;
9+
10+
/**
11+
* @author 恒宇少年
12+
*/
13+
public class ServerConfigurationCustomizers {
14+
private List<ServerConfigurationCustomizer> customizers;
15+
16+
public ServerConfigurationCustomizers(List<ServerConfigurationCustomizer> customizers) {
17+
this.customizers = (customizers != null) ? new ArrayList<>(customizers) : Collections.emptyList();
18+
}
19+
20+
public ServerConfiguration customizer(ServerConfiguration configuration) {
21+
LambdaSafe.callbacks(ServerConfigurationCustomizer.class, this.customizers, configuration)
22+
.withLogger(ServerConfigurationCustomizer.class).invoke((customizer) -> customizer.customize(configuration));
23+
return configuration;
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.minbox.framework.api.boot.autoconfigure.ssh;
2+
3+
import org.minbox.framework.ssh.agent.AgentConnection;
4+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
5+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
6+
import org.springframework.context.annotation.Configuration;
7+
import org.springframework.context.annotation.Import;
8+
9+
/**
10+
* The ssh agent configuration
11+
*
12+
* @author 恒宇少年
13+
* @see SshAgentServletContextListener
14+
*/
15+
@Configuration
16+
@ConditionalOnClass(AgentConnection.class)
17+
@EnableConfigurationProperties(SshAgentProperties.class)
18+
@Import(SshAgentServletContextListener.class)
19+
public class SshAgentAutoConfiguration {
20+
// ...
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.minbox.framework.api.boot.autoconfigure.ssh;
2+
3+
import lombok.Data;
4+
import org.minbox.framework.ssh.agent.config.AgentConfig;
5+
import org.springframework.boot.context.properties.ConfigurationProperties;
6+
import org.springframework.context.annotation.Configuration;
7+
8+
import java.util.List;
9+
10+
import static org.minbox.framework.api.boot.autoconfigure.ssh.SshAgentProperties.SSH_AGENT_PREFIX;
11+
12+
/**
13+
* Ssh agent config properties
14+
*
15+
* @author 恒宇少年
16+
*/
17+
@Data
18+
@Configuration
19+
@ConfigurationProperties(prefix = SSH_AGENT_PREFIX)
20+
public class SshAgentProperties {
21+
/**
22+
* The config prefix of ssh-agent
23+
*/
24+
public static final String SSH_AGENT_PREFIX = "api.boot.ssh-agent";
25+
/**
26+
* The config collection of {@link AgentConfig}
27+
* <p>
28+
* Use this parameter to configure proxy multiple remote server port forwarding information
29+
*/
30+
private List<AgentConfig> configs;
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package org.minbox.framework.api.boot.autoconfigure.ssh;
2+
3+
import lombok.extern.slf4j.Slf4j;
4+
import org.minbox.framework.ssh.agent.AgentConnection;
5+
import org.minbox.framework.ssh.agent.DefaultAgentConnection;
6+
import org.minbox.framework.ssh.agent.config.AgentConfig;
7+
import org.springframework.context.annotation.Configuration;
8+
import org.springframework.util.ObjectUtils;
9+
10+
import javax.servlet.ServletContext;
11+
import javax.servlet.ServletContextEvent;
12+
import javax.servlet.ServletContextListener;
13+
import javax.servlet.annotation.WebListener;
14+
import java.util.ArrayList;
15+
import java.util.List;
16+
17+
/**
18+
* The ssh-agent web listener
19+
* <p>
20+
* Establish a proxy forwarding channel after the servlet context is created when the project starts
21+
*
22+
* @author 恒宇少年
23+
*/
24+
@Configuration
25+
@Slf4j
26+
@WebListener
27+
public class SshAgentServletContextListener implements ServletContextListener {
28+
/**
29+
* The ssh-agent auto config properties
30+
*/
31+
private SshAgentProperties sshAgentProperties;
32+
/**
33+
* Cache a list of AgentConnection objects
34+
*/
35+
private List<AgentConnection> connections = new ArrayList<>();
36+
37+
public SshAgentServletContextListener(SshAgentProperties sshAgentProperties) {
38+
this.sshAgentProperties = sshAgentProperties;
39+
}
40+
41+
/**
42+
* {@link ServletContext} initialized method
43+
* <p>
44+
* Create an {@link AgentConnection} instance according to each {@link AgentConfig} and perform port forwarding connection
45+
*
46+
* @param sce The {@link ServletContextEvent} instance
47+
* @see DefaultAgentConnection
48+
*/
49+
@Override
50+
public void contextInitialized(ServletContextEvent sce) {
51+
List<AgentConfig> configs = sshAgentProperties.getConfigs();
52+
if (ObjectUtils.isEmpty(configs)) {
53+
log.warn("ssh-agent agent does not take effect, reason: agent information is not configured.");
54+
return;
55+
}
56+
configs.stream().forEach(config -> {
57+
AgentConnection connection = new DefaultAgentConnection(config);
58+
this.connections.add(connection);
59+
connection.connect();
60+
});
61+
}
62+
63+
/**
64+
* {@link ServletContext} destroy method
65+
* <p>
66+
* Disconnect all connections in the AgentConnection cache list
67+
*
68+
* @param sce The {@link ServletContextEvent} instance
69+
*/
70+
@Override
71+
public void contextDestroyed(ServletContextEvent sce) {
72+
connections.stream().forEach(connection -> connection.disconnect());
73+
}
74+
}

api-boot-project/api-boot-autoconfigure/src/main/resources/META-INF/spring.factories

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2424
org.minbox.framework.api.boot.autoconfigure.mongo.ApiBootMongoClientSettingsAutoConfiguration,\
2525
org.minbox.framework.api.boot.autoconfigure.tools.ApiBootToolsAutoConfiguration,\
2626
org.minbox.framework.api.boot.autoconfigure.message.pipe.client.MessagePipeClientAutoConfiguration,\
27-
org.minbox.framework.api.boot.autoconfigure.message.pipe.server.MessagePipeServerAutoConfiguration
27+
org.minbox.framework.api.boot.autoconfigure.message.pipe.server.MessagePipeServerAutoConfiguration,\
28+
org.minbox.framework.api.boot.autoconfigure.ssh.SshAgentAutoConfiguration

api-boot-project/api-boot-dependencies/pom.xml

+11-75
Original file line numberDiff line numberDiff line change
@@ -14,61 +14,28 @@
1414
<artifactId>api-boot-dependencies</artifactId>
1515
<properties>
1616
<main.basedir>${basedir}/../..</main.basedir>
17-
18-
<!--Spring Projects-->
19-
<spring.version>5.2.9.RELEASE</spring.version>
20-
<spring.boot.version>2.3.4.RELEASE</spring.boot.version>
21-
22-
<code.builder.core.version>1.0.5.RELEASE</code.builder.core.version>
23-
24-
<!--Others-->
25-
<druid.starter.version>1.1.21</druid.starter.version>
26-
<reflections.version>0.9.11</reflections.version>
27-
<jpush-client.version>3.3.11</jpush-client.version>
28-
<mysema.codegen.version>0.6.8</mysema.codegen.version>
29-
<javax-annotation-api.version>1.3.2</javax-annotation-api.version>
30-
<nacos.config.version>0.2.7</nacos.config.version>
31-
32-
<!--Plugins-->
33-
<maven-plugin-api.version>3.6.1</maven-plugin-api.version>
34-
<maven-plugin-annotations.version>3.6.0</maven-plugin-annotations.version>
17+
<minbox-bom.version>1.0.4</minbox-bom.version>
18+
<spring.boot.version>2.3.6.RELEASE</spring.boot.version>
19+
<spring-cloud.version>2.2.6.RELEASE</spring-cloud.version>
3520
<maven-plugin-plugin.version>3.6.0</maven-plugin-plugin.version>
36-
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
3721
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
38-
3922
</properties>
4023
<dependencyManagement>
4124
<dependencies>
42-
<!--Bom Dependencies-->
4325
<dependency>
4426
<groupId>org.springframework.boot</groupId>
4527
<artifactId>spring-boot-dependencies</artifactId>
4628
<version>${spring.boot.version}</version>
4729
<type>pom</type>
4830
<scope>import</scope>
4931
</dependency>
50-
51-
<!--SpringBoot Related Dependencies-->
52-
<dependency>
53-
<groupId>com.alibaba</groupId>
54-
<artifactId>druid-spring-boot-starter</artifactId>
55-
<version>${druid.starter.version}</version>
56-
</dependency>
5732
<dependency>
58-
<groupId>com.alibaba.boot</groupId>
59-
<artifactId>nacos-config-spring-boot-starter</artifactId>
60-
<version>${nacos.config.version}</version>
61-
</dependency>
62-
63-
<!--MinBox Dependencies-->
64-
<dependency>
65-
<groupId>com.gitee.hengboy</groupId>
66-
<artifactId>code-builder-core</artifactId>
67-
<version>${code.builder.core.version}</version>
33+
<groupId>org.minbox.framework</groupId>
34+
<artifactId>minbox-bom</artifactId>
35+
<version>${minbox-bom.version}</version>
36+
<scope>import</scope>
37+
<type>pom</type>
6838
</dependency>
69-
70-
71-
<!--ApiBoot Dependencies-->
7239
<dependency>
7340
<groupId>org.minbox.framework</groupId>
7441
<artifactId>api-boot</artifactId>
@@ -89,9 +56,6 @@
8956
<artifactId>api-boot-tools</artifactId>
9057
<version>${project.version}</version>
9158
</dependency>
92-
93-
94-
<!--ApiBoot Starters-->
9559
<dependency>
9660
<groupId>org.minbox.framework</groupId>
9761
<artifactId>api-boot-starter</artifactId>
@@ -192,38 +156,10 @@
192156
<artifactId>api-boot-starter-message-pipe-server</artifactId>
193157
<version>${project.version}</version>
194158
</dependency>
195-
196-
197-
<!--Others-->
198-
<dependency>
199-
<groupId>org.reflections</groupId>
200-
<artifactId>reflections</artifactId>
201-
<version>${reflections.version}</version>
202-
</dependency>
203-
<dependency>
204-
<groupId>org.apache.maven</groupId>
205-
<artifactId>maven-plugin-api</artifactId>
206-
<version>${maven-plugin-api.version}</version>
207-
</dependency>
208159
<dependency>
209-
<groupId>org.apache.maven.plugin-tools</groupId>
210-
<artifactId>maven-plugin-annotations</artifactId>
211-
<version>${maven-plugin-annotations.version}</version>
212-
</dependency>
213-
<dependency>
214-
<groupId>cn.jpush.api</groupId>
215-
<artifactId>jpush-client</artifactId>
216-
<version>${jpush-client.version}</version>
217-
</dependency>
218-
<dependency>
219-
<groupId>com.mysema.codegen</groupId>
220-
<artifactId>codegen</artifactId>
221-
<version>${mysema.codegen.version}</version>
222-
</dependency>
223-
<dependency>
224-
<groupId>javax.annotation</groupId>
225-
<artifactId>javax.annotation-api</artifactId>
226-
<version>${javax-annotation-api.version}</version>
160+
<groupId>org.minbox.framework</groupId>
161+
<artifactId>api-boot-starter-ssh-agent</artifactId>
162+
<version>${project.version}</version>
227163
</dependency>
228164
</dependencies>
229165
</dependencyManagement>

0 commit comments

Comments
 (0)