assembly .xml

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">

    <formats>

        <format>zip</format>    <!-- 设置打包后的格式为zip -->

    </formats>

    <fileSets> <!-- 要打包的文件 -->

        <fileSet> <!-- 根目录下的readme、license、notice文件 -->

            <directory>${project.basedir}</directory>

            <outputDirectory>/</outputDirectory>

            <includes>

                <include>README*</include>

                <include>LICENSE*</include>

                <include>NOTICE*</include>

            </includes>

        </fileSet>

        <fileSet><!-- bin目录下的所有文件(批处理文件) -->

            <directory>${project.basedir}/bin</directory>

            <outputDirectory>/</outputDirectory>

        </fileSet>
<fileSet><!-- target目录下的jar包 --> <directory>${project.build.directory}/</directory> <outputDirectory>/</outputDirectory> <includes> <include>*.jar</include> </includes> </fileSet> </fileSets> <dependencySets> <!-- 打包的依赖jar, 放置在lib下 --> <dependencySet> <outputDirectory>/lib</outputDirectory> <useProjectArtifact>false</useProjectArtifact> <scope>runtime</scope> </dependencySet> </dependencySets> </assembly>

Pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<artifactId>module-im</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>module-im</name>
<parent>
<groupId>com.shj</groupId>
<artifactId>micro-service-parent</artifactId>
<version>1.0.0</version>
</parent>
<properties>
<project.build.name>im</project.build.name>
</properties>
<dependencies>
<dependency>
<groupId>com.shj</groupId>
<artifactId>interface-im</artifactId>
<version>${ykee.version}</version>
</dependency>
</dependencies>
<build>
<finalName>module-im</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor><!-- 指定assembly配置文件路径 -->
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath><!-- 增加classpath -->
<classpathPrefix>lib/</classpathPrefix><!-- classpath路径前缀 -->
<mainClass>com.shj.ms.im.ImApplication</mainClass><!-- 程序主入口类 -->
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

Maven assembly 打包的更多相关文章

  1. Maven Assembly打包提示[WARNING] transitive dependencies if any will not be available

    maven assembly打包出现错误 [WARNING] The POM for com.flink.xxr:0.0.1-SNAPSHOT is invalid, transitive depen ...

  2. maven项目用assembly打包可执行jar包

    该方法只可打包非spring项目的可执行jar包,spring项目可参考:http://www.cnblogs.com/guazi/p/6789679.html 1.添加maven插件: <!- ...

  3. 记录一次maven打包时将test目录下的类打包到jar中,Maven Assembly Plugin的使用

    今天有人问我打包后找不到主类,运行的类写在test中.按照常规,test目录下的文件不会打包到jar包中.(但是我测试一个springboot工程就可以,这里之后再研究) 具体解决如下 第一步:在po ...

  4. java工程打成jar包 - 使用maven assembly插件打包及手动打包

    在java工程打包的过程中遇到过不少问题,现在总结一下.一种是典型的maven工程打包,依赖的jar包全都在pom.xml中指定,这种方式打包很方便:另一种是依赖了本机jar包(不能通过pom.xml ...

  5. assembly打包实例

    1.先在pom.xml文件中添加assembly打包插件 <build> <plugins> <plugin> <groupId>org.apache. ...

  6. eclipse下将maven项目打包为jar(1.不带第三方jar,2.带第三方jar)

    由于项目需要讲maven项目打包为jar包,由于之前没类似经验,百度找例子走了不少弯路,这边随手记录下,网上说的 开发工具:eclipse jar包管理:maven 一般打包出来的jar包分为两种 一 ...

  7. 将Maven项目打包成可执行jar文件(引用第三方jar)

    方法一. mvn assembly 或 mvn package (一个jar包) 把依赖包和自己项目的文件打包如同一个jar包(这种方式对spring的项目不支持) <build>     ...

  8. maven assembly plugin使用

    使用场景 在使用maven来管理项目时,项目除了web项目,还有可能为控制台程序,一般用于开发一些后台服务的程序.最近在工作中也遇到了这种场景,使用quartz开发一个任务调度程序.程序中依赖很多ja ...

  9. Maven Assembly插件介绍

    转自:http://blueram.iteye.com/blog/1684070 已经写得挺好的,就不用重写了. 你是否想要创建一个包含脚本.配置文件以及所有运行时所依赖的元素(jar)Assembl ...

随机推荐

  1. webstrom live templates

    javascript: 在live templates底部要选择javascript # $('#$END$') $ $($end$) $bd $(document.body) $d $(docume ...

  2. button 样式

    /** * 个人资料 */Ext.define('For.view.personal.MyPersonalData',{            extend:'Ext.panel.Panel',   ...

  3. docker-compose启动的tomcat无法远程连接jmx

    最近想学习下java GC优化,就用了一下VisualVM,在远程服务器启动了一个非docker的tomcat,很顺利的就连接了,但是用docker-compose启动的服务却 怎么也连不上,一定是d ...

  4. 解决ppt中视频不能播放的问题

    小伙伴一直在纠结一个问题,有个ppt,在其他人的电脑上可以正常播放其中的视频,但是在某一个电脑上却总是不能播放,一直没找到原因,俺们今早捯饬了一下,貌似找到一丢丢原因和解决办法了. #1,疑似原因 为 ...

  5. tomcat7配置虚拟目录

    1.tomcat7的安装路径下,D:\Program Files\java\Tomcat 7.0\conf,修改server.xml文件,如图: 在</Host>标签前,添加上图选中部分即 ...

  6. LeetCode:Word Ladder I II

    其他LeetCode题目欢迎访问:LeetCode结题报告索引 LeetCode:Word Ladder Given two words (start and end), and a dictiona ...

  7. couldn't open file: data/coco.names

    在ubuntu下配置yolo(v2)的时候,编译了源码后,尝试运行demo: ./darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg 结果报错提 ...

  8. py-faster-rcnn +cudnn V5

    转载自http://blog.csdn.net/u010733679/article/details/52221404,经过实际操作,采用了第二种手动替换代码文件.修改个别函数名的方式,成功编译. - ...

  9. Codeforces Round #374 (Div. 2)

    A题和B题是一如既往的签到题. C题是一道拓扑序dp题,题意是给定一个DAG,问你从1号点走到n号点,在长度不超过T的情况下,要求经过的点数最多,换个思维,设dp[i][j]表示到i号点时经过j个点的 ...

  10. bzoj 4318 OSU!

    期望dp. 考虑问题的简化版:一个数列有n个数,每位有pi的概率为1,否则为0.求以每一位结尾的全为1的后缀长度的期望. 递推就好了. l1[i]=(l1[i-1]+1)*p[i]+0*(1-p[i] ...