免费的微网站哪个好,网络运营具体做什么,东莞网站定制,python基础教程第二版大家好#xff0c;我是烤鸭#xff1a; 今天分享一下springboot将jar包打包到指定目录下。 由于之前上线都是一个打包到一个jar#xff0c;由于服务多了#xff0c;1个包100多M#xff0c;哪怕是小版本上线都需要重新上传jar包。
1.目的 将不常用的比如spring,druid等不常…大家好我是烤鸭 今天分享一下springboot将jar包打包到指定目录下。 由于之前上线都是一个打包到一个jar由于服务多了1个包100多M哪怕是小版本上线都需要重新上传jar包。
1.目的 将不常用的比如spring,druid等不常用打包到lib目录这样每次上线不需要上传这些。第三方或者常改动的还打包到本身的jar包内每次上线都会新打包。 这样原来的100多M的jar包可以变成2、3M。 如图所示 原来的打包方式 改后的方式 2.修改pom 简单解释一下includes标签内就是打入jar包第三方jar。将上面的2M的包解压缩后就是includes的包。如图所示。 excludeGroupIds和excludeArtifactIds 是配置不在lib目录里的包由于java启动加载的机制是优先加载jar包 再加载外部目录如果jar包都存在两个地方这样配置就没有意义了每次还是得重新发布lib目录所以将includes 中的包再在excludeGroupIds 和 excludeArtifactIds 配置上。
buildpluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactIdversion2.0.5.RELEASE/versionexecutionsexecutiongoalsgoalrepackage/goalgoalbuild-info/goal/goals/execution/executionsconfigurationlayoutZIP/layoutincludesincludegroupIdnothing/groupIdartifactIdnothing/artifactId/includeincludegroupIdcom.etc/groupIdartifactIdetc-manage-api/artifactId/includeincludegroupIdcom.etc/groupIdartifactIdetc-manage-core/artifactId/includeincludegroupIdcom.etc/groupIdartifactIdetc-manage-rpc-api/artifactId/includeincludegroupIdcom.sinoiov.etc.apollo/groupIdartifactIdapollo-spring-boot-starter/artifactId/include/includes/configuration/pluginplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-dependency-plugin/artifactIdexecutionsexecutionidcopy/idphasepackage/phasegoalsgoalcopy-dependencies/goal/goalsconfigurationexcludeGroupIdscom.sinoiov.etc.apollo/excludeGroupIdsexcludeArtifactIdsetc-manage-api,etc-manage-core,etc-manage-rpc-api/excludeArtifactIdsoutputDirectory${project.build.directory}/lib/outputDirectory/configuration/execution/executions/plugin/plugins
/build
3.修改启动脚本 原脚本
java -jar etc-manage-service-basic-2.2.0.jar
现脚本 (如果相对目录不好用就用绝对目录试试)
java Dloader.path../lib -jar etc-manage-service-basic-2.2.0.jar