maven 小结(打包和单元测试)
程序员文章站
2023-12-27 22:46:27
...
1. 如何把一个jar和他依赖的包打包成一个
使用maven so easy!
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <finalName>tlog2-service-test</finalName> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.taobao.tlog.test.StarAgentGatherTester</mainClass> </transformer> </transformers> </configuration> </plugin> </plugins> </build>
2. 如果希望单元测试代码也被打包
参考:http://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
推荐阅读
-
maven 小结(打包和单元测试)
-
浅谈maven的jar包和war包区别 以及打包方法
-
关于webpack2和模块打包的新手指南(小结)
-
方便maven的web项目打包和直接部署到tomcat的设置
-
荐 Gitlab webhooks Jenkins Android 打包: 外网Centos8主机 + FRP内网穿透 +私有内网Git源码和Maven仓库
-
关于webpack2和模块打包的新手指南(小结)
-
maven打包漏掉mapper.xml和配置文件
-
使用maven实现单元测试和集成测试
-
方便maven的web项目打包和直接部署到tomcat的设置
-
maven打包No compiler is provided in this environment和没有主清单属性