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

maven打包插件配置模板

主要有两类:

1、maven-shade-plugin

主要用于java程序编写的的打包

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <excludes>
                  <exclude>com.google.code.findbugs:jsr305</exclude>
                  <exclude>org.slf4j:*</exclude>
                  <exclude>log4j:*</exclude>
                  <exclude>org.apache.hadoop:*</exclude>
                </excludes>
              </artifactSet>
              <filters>
                <filter>
                  <!-- Do not copy the signatures in the META-INF folder.
                  Otherwise, this might cause SecurityExceptions when using the JAR. -->
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers combine.children="append">
                <transformer
                        implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer">
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

2、maven-assembly-plugin

主要用于scala和java编写的程序的打包插件(更推荐于scala,java有时候会有问题)



org.apache.maven.plugins
maven-assembly-plugin
3.0.0


jar-with-dependencies




make-assembly
package

single





org.apache.maven.plugins
maven-compiler-plugin
3.8.0

j a v a . v e r s i o n < / s o u r c e > < t a r g e t > {java.version}</source> <target> java.version</source><target>{java.version}
UTF-8




http://www.kler.cn/news/134607.html

相关文章:

  • 汇编-指针
  • npm install 下载不下来依赖解决方案
  • git安装后报git: ‘remote-https‘ is not a git command. See ‘git --help‘.
  • 【Ant Design合集】自用总结
  • IDEA 集成 Docker 插件一键部署 SpringBoot 应用
  • 解决小程序路由超过10层限制
  • 面试题c/c++--语言基础
  • SDL2 播放音频数据(PCM)
  • TP_Link WR886N 硬改闪存16M内存64M,刷入openwrt
  • JSP 四大域对象
  • 分类预测 | Matlab实现基于PSO-SDAE粒子群优化算法优化堆叠去噪自编码器的数据分类预测
  • 【开源】基于JAVA的超市自助付款系统
  • NewStarCTF2023 Reverse方向Week3 ez_chal WP
  • Unity开发之C#基础-集合(字典)(Dictionary)
  • 【C++】​——多态性与模板(其一)
  • 前端 webpack 面试题
  • nginx学习(3)Nginx 负载均衡
  • 2023年中国地产SaaS分类、产业链及市场规模分析[图]
  • 在Go编程中调用外部命令的几种场景
  • 大学生如何免费认证,下载,安装MATLAB
  • 2023年中国稀土精密加工分类、市场规模及发展趋势分析[图]
  • 【SpringBoot3+Vue3】四【基础篇】-前端(vue基础)
  • 2023年中国全自动烘干机产业链、产能及发展趋势分析[图]
  • webpack 中,filename 和 chunkFilename 的区别
  • 全屋智能:鱼很大,但水更深
  • 【cpolar】搭建我的世界Java版服务器,公网远程联机
  • Python中,我们可以使用pandas和numpy库对Excel数据进行预处理,包括读取数据、数据清洗、异常值剔除等
  • Auto.js 清除指定应用缓存
  • RHCSA --- Linux存储管理
  • 定时器相关方法