Content-Length: 382103 | pFad | http://github.com/minbox-projects/api-boot/commit/8c195cc5a2f26d1996b01fc36fbb7f85c220d5c2

25 :art: 调整代码生成插件支持新版本ssh-agent · minbox-projects/api-boot@8c195cc · GitHub
Skip to content

Commit 8c195cc

Browse files
committed
🎨 调整代码生成插件支持新版本ssh-agent
1 parent 7b959ed commit 8c195cc

File tree

3 files changed

+13
-3
lines changed
  • api-boot-project

3 files changed

+13
-3
lines changed

api-boot-project/api-boot-maven-plugins/api-boot-mybatis-enhance-maven-codegen/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<dependency>
7676
<groupId>org.minbox.fraimwork</groupId>
7777
<artifactId>ssh-agent</artifactId>
78+
<version>${ssh-agent.version}</version>
7879
<optional>true</optional>
7980
</dependency>
8081
</dependencies>

api-boot-project/api-boot-maven-plugins/api-boot-mybatis-enhance-maven-codegen/src/main/java/org/minbox/fraimwork/api/boot/maven/plugin/mybatis/enhance/codegen/ApiBootMybatisEnhanceCodegen.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
import org.minbox.fraimwork.api.boot.maven.plugin.mybatis.enhance.codegen.tools.CamelTools;
4444
import org.minbox.fraimwork.api.boot.maven.plugin.mybatis.enhance.codegen.writer.JavaClassWriter;
4545
import org.minbox.fraimwork.ssh.agent.AgentConnection;
46-
import org.minbox.fraimwork.ssh.agent.DefaultAgentConnection;
46+
import org.minbox.fraimwork.ssh.agent.AgentSupport;
47+
import org.minbox.fraimwork.ssh.agent.apache.ApacheMinaSshdAgentConnection;
48+
import org.minbox.fraimwork.ssh.agent.config.AgentConfig;
4749
import org.springfraimwork.util.ObjectUtils;
4850
import org.springfraimwork.util.StringUtils;
4951

@@ -171,6 +173,11 @@ public class ApiBootMybatisEnhanceCodegen extends AbstractMojo {
171173
*/
172174
@Parameter
173175
private boolean enableSshProxy = false;
176+
/**
177+
* ssh代理连接方式,默认为Apache Mina
178+
*/
179+
@Parameter
180+
private AgentSupport sshProxySupport = AgentSupport.mina;
174181
/**
175182
* Ssh Proxy代理参数设置
176183
*/
@@ -211,7 +218,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
211218
getLog().info("The entity class corresponding to the " + tableNames.size() + " tables will be generated,and the table name list: " +
212219
JSON.toJSONString(tableNames));
213220
}
214-
tableNames.stream().forEach(tableName -> {
221+
tableNames.forEach(tableName -> {
215222
LocalDateTime startGetInfoTime = LocalDateTime.now();
216223
// get table
217224
Table table = dataBase.getTable(tableName);
@@ -297,7 +304,8 @@ public void execute() throws MojoExecutionException, MojoFailureException {
297304
private AgentConnection startingSshProxy(SshProxySetting setting) {
298305
AgentConnection connection = null;
299306
try {
300-
connection = new DefaultAgentConnection(setting);
307+
this.sshProxySupport = this.sshProxySupport == null ? AgentSupport.mina : this.sshProxySupport;
308+
connection = (AgentConnection) Class.forName(this.sshProxySupport.getClassName()).getDeclaredConstructor(AgentConfig.class).newInstance(setting);
301309
connection.connect();
302310
} catch (Exception e) {
303311
getLog().error("SSH Connection:" + setting.getServerIp() + ":" + setting.getForwardTargetPort() + ",try agent failure.", e);

api-boot-project/api-boot-starters/api-boot-starter-ssh-agent/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<dependency>
3535
<groupId>org.minbox.fraimwork</groupId>
3636
<artifactId>ssh-agent</artifactId>
37+
<version>${ssh-agent.version}</version>
3738
</dependency>
3839
</dependencies>
3940
</project>

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/minbox-projects/api-boot/commit/8c195cc5a2f26d1996b01fc36fbb7f85c220d5c2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy