前言 线上包,要加一个加密的配置包,但是不想重新打包过去,值加一个配置类
jar 包解压和重新打包命令
可以用解压软件解压也可以用命令解压
解压jar包命令: jar xvf xxx.jar
打包jar包命令: jar cvfM0 admin.jar ./* ( * 或者 ./* 都可以)
-
先把 这个jar 解压了,然后把 BOOT-INF/lib 里面的jia包该添加添加该替换替换,如果只是增加class类,则到 BOOT-INF/classes 把相应的class放到相应的类路径上 -
替换好后,可以用这个指令: jar cvfM0 business-starter.jar * ( * 表示当前目录所有文件) -
重新打包好后,替换过去重启服务即可
maven 分离依赖的插件配置
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.gov.platform.AdapterApiApplication</mainClass>
</manifest>
</archive>
<excludes>
<exclude>/application*.properties</exclude>
</excludes>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<includeScope>runtime</includeScope>
<excludeArtifactIds>jwt-plugin</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
<addResources>true</addResources>
<outputDirectory>${project.build.directory}</outputDirectory>
<includes>
<include>
<groupId>com.gov.platform</groupId>
<artifactId>jwt-plugin</artifactId>
</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
|