<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. 实践作业3:白盒测试----第三次小组会DAY8

    我们小组于12月11日在东九教学楼召开了会议,小组第二次会议中就讨论了被测系统中风险最高的模块,于是选择管理员的教师添加模块,针对代码展开静态评审.这一次会议,小组主要讨论了应该从哪些方面来测评代码的 ...

  2. js实现水平伸缩菜单

    window.onload=function(){ var aA=document.getElementsByTagName('a'); for(var i=0; i<aA.length; i+ ...

  3. jQuary总结1:jQuary的优点和地位

    1 什么是jQuery? jQuery是一个快速,小巧,功能丰富的JavaScript库. javascript库: 就是存放javascript代码的仓库 jQuery作为一个迭代多年的优秀框架,是 ...

  4. Linq学习<五> 运用linq查询Xml

    这节将学习如何用 linq查询xml 一.我们先看看在xml中我们怎么操作 public void xmlWayToQueryXmlFile() { XmlDocument xmldoc = new ...

  5. Android--iOS抓取崩溃日志

    android闪退获取日志方法: 1.下载adb工具包 2.注意事项 请确保电脑上只连接了一台手机设备(最好只连接一条USB线),同时确保手机已开启USB调试模式(可通过手机助手查看连接状态) 3.A ...

  6. @cms_content_list

    [@cms_content_list typeId='1,2,3' count='18' orderBy='4' channelId='75' channelOption='0' dateFormat ...

  7. python之文件操作总结

    目录 文件:数据的抽象和集合 文件的打开关闭 文件内容的读取 文件的全文本操作 文件的逐行操作 数据文件的写入 使用json模块 文件:数据的抽象和集合 文件是存储在辅助存储器上的数据序列 文件是数据 ...

  8. jquery datepicker 中文

    <script type="text/javascript"> jQuery(function(){ $.datepicker.regional['zh-CN'] =  ...

  9. ios系统架构及常用框架

    1.iOS基于UNIX系统,因此从系统的稳定性上来说它要比其他操作系统的产品好很多 2.iOS的系统架构分为四层,由上到下一次为:可触摸层(Cocoa Touch layer).媒体层(Media l ...

  10. webservice 创建及调用

    1.创建一个空白项目 2.在此项目上新建项--添加一个web服务 (.asmx) 这样就创建好了一个webservice --------------------------------------- ...