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. 将“早期版本的Windows”改名

    将“早期版本的Windows”改名,并修改系统等待时间 问题描述:       先装Windows XP,再装Windows 7,启动菜单会出现“早期版本的Windows”与“Windows 7”两个 ...

  2. 断今天日期和指定日期相等和两者的时间差为两年的sql

    1.  ---判断今天日期和指定日期相等 update store  set Status =1 where CONVERT(varchar(12) ,opendate, 105 )= CONVERT ...

  3. 吉特仓库管理系统(开源)-如何在网页端启动WinForm 程序

    在逛淘宝或者使用QQ相关的产品的时候,比如淘宝我要联系店家点击旺旺图标的时候能够自动启动阿里旺旺进行聊天.之前很奇怪为什么网页端能够自动启动客户端程序,最近在开发吉特仓储管理系统的时候也遇到一个类似的 ...

  4. Memcached 服务器端命令

    memcached的基本命令(安装.卸载.启动.配置相关): -p 监听的端口   -l 连接的IP地址, 默认是本机    -d start 启动memcached服务   -d restart 重 ...

  5. Java链栈

    package com.lxm.customDataStructure; public class LinkStack<T>{ class Node<T>{ T data; N ...

  6. mui消息框alert,confirm,prompt,toast

    <script type="text/javascript" charset="utf-8"> //mui初始化 mui.init({ swipeB ...

  7. Configure Security Settings for Remote Desktop(RDP) Services Connections

    catalogue . Configure Server Authentication and Encryption Levels . Configure Network Level Authenti ...

  8. MySQL二进制安装

    前提 version mysql-5.5 platform centos6.x 添加用户 useradd -M -s /sbin/nologin mysql 安装需要的包 yum -y install ...

  9. 记一次MYSQL更新优化

    引言 今天(August 5, 2015 5:34 PM)在给数据库中一张表的结构做一次调整,添加了几个字段,后面对之前的数据进行刷新,刷新的内容是:对其中的一个已有字段url进行匹配,然后更新新加的 ...

  10. hackerrank Similar Pair

    传送门 Problem Statement You are given a tree where each node is labeled from 1 to n. How many similar ...