3.1 mvn build优化
javac -classpath a.jar:b.jar.... --source-path ..
docker build可以使用SYNC语法;
build.output.copyonly=true build.output=appA-bootstrap-start/target/appA
<plugin><artifactId>maven-antrun-plugin</artifactId><executions> <execution> <phase>package</phase> <configuration> <tasks> <unzip src="${project.build.directory}/${project.build.finalName}.${project.packaging}" dest="${project.build.directory}/appA"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution></executions></plugin>
<plugin><groupId>com.alibaba.citrus.tool</groupId><artifactId>autoconfig-plugin</artifactId><version>2.0.10</version><configuration> <dest>${project.build.directory}/appA/BOOT-INF/lib</dest> <type>jar</type> <isListDestFiles>true</isListDestFiles></configuration><executions> <execution> <phase>package</phase> <goals> <goal>autoconfig</goal> </goals> </execution></executions></plugin>
COPY ${APP_NAME}.tgz /home/admin/${APP_NAME}/target/${APP_NAME}.tgz
COPY build-output/ /home/admin/${APP_NAME}/target/${APP_NAME}/
3.2 docker build优化
COPY build-output/ /home/admin/${APP_NAME}/target/${APP_NAME}/
SYNC build-output/ /home/admin/appA/target/appA
启用amaven增量编译;
升级autoconfig插件;
往期推荐