<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. HBase预分区方法

    (what)什么是预分区? HBase表在刚刚被创建时,只有1个分区(region),当一个region过大(达到hbase.hregion.max.filesize属性中定义的阈值,默认10GB)时 ...

  2. lnmp 多站点配置负载均衡

    1.虚拟机安装3个centos 2.三台服务器IP: 192.168.191.129(主)192.168.191.130192.168.191.131 3.分别在3台服务器的vhost目录下新建配置文 ...

  3. Union、Union All、Intersect、Minus

    转自:http://www.2cto.com/database/201208/148795.html Union:对两个结果集进行并集操作,不包括重复行,同时进行默认规则的排序: Union All: ...

  4. UVa 11090 Going in Cycle!! (Bellman_Ford)

    题意:给定一个加权有向图,求平均权值最小的回路. 析:先十分答案,假设答案是 ans,那么有这么一个回路,w1+w2+w3+...+wk < k*ans,这样就是答案太大,然后移项可得,(w1- ...

  5. 使用virtualBox安装CentOS 6.3的详细步骤

    由于前几天把系统升级到win7了,原先安装的Linux虚拟机都不存在了.基于学习,这次安装选择的是CentOS 6.3版本. 下面就看看具体的安装步骤: 名称可以随便填写,类型选择Linux,版本选择 ...

  6. [Selenium With C#基础教程] Lesson-05 文本框

    作者:Surpassme 来源:http://www.jianshu.com/p/7dca7d0d1ea3 声明:本文为原创文章,如需转载请在文章页面明显位置给出原文链接,谢谢. 文本框在Web页面中 ...

  7. 设计模式3---工厂模式(Factory Pattern简单工厂、工厂方法、抽象工厂)

    工厂模式:主要用来实例化有共同接口的类,工厂模式可以动态决定应该实例化那一个类.工厂模式的形态工厂模式主要用一下几种形态:1:简单工厂(Simple Factory).2:工厂方法(Factory M ...

  8. memcached整理の基本使用

    memcached 客户端与服务器端的通信比较简单,使用的基于文本的协议,而不是二进制协议.(http 协议也是这样), 因此我们通过telnet 即可与memcached 作交互. # 格式teln ...

  9. [QPlugins]学习大纲

    QPlugins是一个DELPHI实现的插件框架,官方网址是:http://www.qdac.cc/ . 把学习QPlugins的过程和心得做一个记录,以便应用到项目中,同时学习一些实现方法和思想. ...

  10. MyBatis 一级缓存避坑

    MyBatis 一级缓存(MyBaits 称其为 Local Cache)无法关闭,但是有两种级别可选: package org.apache.ibatis.session; /** * @autho ...