当前位置: 首页 > news >正文

Sping Boot 打包排除相关jar依赖包,CMD 启动方式 pom.xml 说明.

Sping Boot 打包排除相关jar依赖包,CMD 启动方式 pom.xml 说明.

Posted on 2025-09-23 11:40  且行且思  阅读(0)  评论(0)    收藏  举报

根目录pom.xml

 <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>2.5.12</version><configuration><includeSystemScope>true</includeSystemScope><excludes><!-- classpath (-cp):JVM原生的类路径机制 cmd 启动如下(路径需包含 项目snowy-common/lib/的依赖包) >> java -Dfile.encoding=utf-8 -cp "snowy-web-app-2.0.0.jar;D:/web/libs/*"  --><!-- 排除ZOS相关jar包 --><exclude><groupId>com.amazonaws</groupId><artifactId>zos-java-sdk-s3</artifactId></exclude><exclude><groupId>com.amazonaws</groupId><artifactId>zos-java-sdk-sts</artifactId></exclude><exclude><groupId>com.amazonaws</groupId><artifactId>aws-java-sdk-iam</artifactId></exclude><exclude><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk18on</artifactId></exclude><exclude><groupId>org.bouncycastle</groupId><artifactId>bcprov-ext-jdk18on</artifactId></exclude><!-- 排除Aspose相关jar包 --><exclude><groupId>com.aspose</groupId><artifactId>aspose-cells</artifactId></exclude><exclude><groupId>com.aspose</groupId><artifactId>aspose-pdf</artifactId></exclude><exclude><groupId>com.aspose</groupId><artifactId>aspose-slides</artifactId></exclude><exclude><groupId>com.aspose</groupId><artifactId>aspose-words</artifactId></exclude></excludes></configuration><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build>

 

启动 .bat


 

.bat  (classpath (-cp):JVM原生的类路径机制)

@echo offtitle PMP_API-%date%-%time%-%cd%java -Dfile.encoding=utf-8 -Dloader.path="D:/web/libs/*"  -Xms1024m -Xmx4096m -XX:PermSize=128M -XX:MaxPermSize=256M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=6001 -jar snowy-web-app-2.0.0.jar --spring.datasource.dynamic.publickey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIamTaG0e6ylJcLqdktHjQh4Jbm7RzCqn0+H8Y2Tu9oR6+Byw0KIu5r9nzIssJx/3exyFPoD9TuCuCmxDrz3XgUCAwEAAQ==