<build>
    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.citi.simpliciti.tempest.g10.util.TestMongo</mainClass>
            </manifest>
            <manifestEntries>
              <Specification-Title>${project.name}</Specification-Title>
              <Specification-Version>${project.version}</Specification-Version>
              <Implementation-Version>${build.number}</Implementation-Version>
              <Change>${project.version}</Change>
              <Build-Date>${maven.build.timestamp}</Build-Date>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.1</version>
        <configuration>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <!-- Refer to:
               https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#AppendingTransformer

               Some jars contain additional resources (such as properties files) that have the
               same file name. To avoid overwriting, you can opt to merge them by appending
               their content into one file.

               For example the spring-context-5.0.7.RELEASE.jar and spring-aop-5.0.7.RELEASE.jar
               both have spring.handlers.

               The spring aop jar's content is
               http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler

               The spring context jar's content is
               http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler
               http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler
               http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler
               http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler
               http://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler

               With the AppendingTransformer they can be consolidated into one spring.handlers.

               Without AppendingTransformer, the former jar's handlers will be overwritten.
               In that case, some flow/topology submission will fail.
            -->
            <configuration>
              <transformers>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.handlers</resource>
                </transformer>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.schemas</resource>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

maven 可执行jar maven-shade-plugin的更多相关文章

  1. Maven可执行jar包

    参考文章: Maven生成可以直接运行的jar包的多种方式(http://blog.csdn.net/xiao__gui/article/details/47341385) 一般,我们通过 > ...

  2. Java - 在控制台中执行一个可执行jar

    1.Maven打包一个可执行jar: <build> <plugins> <plugin> <groupId>org.apache.maven.plug ...

  3. 施用 maven shade plugin 解决 jar 或类的多版本冲突

    施用 maven shade plugin 解决 jar 或类的多版本冲突   使用 maven shade plugin 解决 jar 或类的多版本冲突java 应用经常会碰到的依赖的三方库出现版本 ...

  4. maven打包可执行jar文件运行报错

    起因 项目中同时依赖了Spring和MyBatis,并使用mybatis-spring集成MyBatis和Spring. 使用maven打包为可执行jar文件运行,打包插件为:maven-shade- ...

  5. Maven- 使用Maven构建一个可执行jar

    How to Create an Executable JAR with Maven 1.最重要的是使用jar类型,<packaging>jar</packaging>.当然不 ...

  6. Java 将Maven项目打成可执行jar包

    一.用maven-shade-plugin打包 在pom.xml文件中加入如下信息,利用Maven的maven-shade-plugin插件进行打包. <build> <plugin ...

  7. Maven打包可执行Jar包方式

    第一步:pom.xm中的build标签下加入maven插件配置,打包生成可执行jar包方式Maven中的打包方式更换为 <packaging>jar</packaging> b ...

  8. [Apache Maven Shade Plugin] [example] [001] 官方例子:includes-excludes

    链接地址:[Selecting Contents for Uber JAR](http://maven.apache.org/plugins/maven-shade-plugin/examples/i ...

  9. Maven编译可执行jar

    打包: 第一种情况:独立项目,且无第三方依赖包 这种情况下,我们需要maven的maven-jar-plugin插件来帮我们打包.请在项目pom.xml中的plugin配置处加入如下内 <plu ...

随机推荐

  1. Debian/Linux系统安全配置教程

    禁止root SSH登陆 配置SSH Key 配置iptables 当我们安装完Linux系统作为服务器后,总有一系列的安全配置需要进行.特别是当你的服务器Ip是对外网开放的话.全世界有很多不怀好意的 ...

  2. octomap相关

    转载自http://blog.csdn.net/linuxarmsummary/article/details/50924947 什么是octomap? RGBD SLAM的目的有两个:估计机器人的轨 ...

  3. 1、概率vs统计

  4. JDBC 连接 MySQL 时碰到的小坑

    最近从MS SQL Server换到了MySQL,已经是8.11版本了,安装的时候似乎还用了新的身份认证方式之类的,连接过程中也是磕磕绊绊,碰到很多奇奇怪怪的问题,在此记录下来. 驱动加载: 以前使用 ...

  5. MySQL 存储过程和存储函数学习

    #一.存储过程和存储函数的创建案例 CREATE PROCEDURE myprocedure(in a int,in b int ,OUT c INT) BEGIN set c=a+b; end; c ...

  6. python之CSV文件格式

    1.csv文件是以一些以逗号分隔的值 import csv filename = "wenjian.csv" with open(filename) as f: reader = ...

  7. 删除emacs临时文件

    emacs编辑文件后产生的带小尾巴(~)的文件,你有没有强迫症,要删之而后快rm -rf *~ 你有没有不小心敲成了rm -rf ~,然后爽快的按下了回车,然后欲哭无泪,哈哈- 其实,可以设置在ema ...

  8. CSS 学习-文本 段落

    段落. 首行缩进 text-indent属性 比如缩进  <p style="text-indent: 2em;">这里是内容....</p> 这里是内容这 ...

  9. jmeter - 命令行方式运行

    命令格式: jmeter -n -t <testplan filename> -l <listener filename> 参数说明: -n 非 GUI 模式 -> 在非 ...

  10. delphi中sql实现while循环插入,不存在则插入

    ' declare @i int; '+ ' set @i=0; '+ ' while @i<4 '+ ' begin '+ ' insert into NBCommission(Type,It ...