pom.xml 添加插件

  <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<webXml>WebContent\WEB-INF\web.xml</webXml>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.XSD</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.defonds.RsaEncryptor</mainClass>
</transformer>
<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>
    <!-- 可执行jar包 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.spider.DYMovieProcessor</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>

  

  

pom.xml:<packaging>jar</packaging> 表示包  war 或者jar

执行:

执行

Maven 编译的更多相关文章

  1. 安装maven编译环境

    安装maven编译环境 1.默认已经装好yum并配置好yum源(推荐使用163yum源) 2.安装JDK 3.安装相关依赖环境(root用户登陆) yum install -y cmake lzo-d ...

  2. maven编译报错 -source 1.5 中不支持 lambda 表达式

    在用maven编译项目是由于项目中用了jdk 1.8, 编译是报错  -source 1.5 中不支持 lambda 表达式,Google找到这篇解决方案,记录一下: 编译时报如下错误: [ERROR ...

  3. Maven编译jar出现:无法确定 T 的类型参数的异常的原因和处理方案

    出错场景: 代码: public class JsonUtil { private static final Gson gson = new GsonBuilder().setDateFormat(& ...

  4. 使用maven编译Java项目 http://www.tuicool.com/articles/YfIfIrq

    使用maven编译Java项目 时间 2014-07-17 17:42:37  Way Lau's Blog 原文  http://www.waylau.com/build-java-project- ...

  5. Spark-1.0.1 的make-distribution.sh编译、SBT编译、Maven编译 三种编译方法

    fesh个人实践,欢迎经验交流!本文Blog地址:http://www.cnblogs.com/fesh/p/3775343.html 本文编译方法所支持的hadoop环境是Hadoop-2.2.0, ...

  6. 使用Maven编译项目遇到——“maven编码gbk的不可映射字符”解决办法 ——转载

    一.问题描述 今天在MyEclipse中使用Maven编译项目源代码时,结果如下了如下的错误

  7. 菜鸟调错(八)—— Maven编译错误:不兼容的类型的解决方案

    泛型在实际的工作中应用非常广泛,关于泛型就不在这里赘述了,感兴趣请戳<重新认识泛型>.项目中用到了如下的泛型: public <T> T query(String sql, R ...

  8. 使用maven编译dubbo,导入eclipse(其他maven开源项目编译类似)

    dubbo github下载地址:https://github.com/alibaba/dubbo 相关文档:http://dubbo.io/ 使用maven编译dubbo,导入eclipse(其他m ...

  9. maven编译时候报"编码 GBK 的不可映射字符"

    决这个问题的思路: 在maven的编译插件中声明正确的字符集编码编码——编译使用的字符集编码与代码文件使用的字符集编码一致!! 安装系统之后,一般中文系统默认字符集是GBK.我们安装的软件一般都继承使 ...

  10. 转】使用Maven编译项目遇到——“maven编码gbk的不可映射字符”解决办法

    原博文出自于: http://www.cnblogs.com/xdp-gacl/p/4239006.html 感谢! 一.问题描述 今天在MyEclipse中使用Maven编译项目源代码时,结果如下了 ...

随机推荐

  1. Python学习杂记_4_分支和循环

    分支 和 循环 分支和循环这俩结构在各语言中都有着很重要的地位,当然我之前都没有学好,这里总结一下在Python学习中对这俩结构的认识. 分支结构 # 单分支 if 条件判断: 执行语句… # 双分支 ...

  2. Python实现简单的Web服务器 解析

    代码来源https://www.shiyanlou.com/courses/552,对它进行理解,注释 #-*- coding:utf-8 -*- import BaseHTTPServer clas ...

  3. Android 设置图片倒影效果

    首先,贴出效果图: 1.布局文件main.xml <?xml version="1.0" encoding="utf-8"?> <Linear ...

  4. nodejs编写实例基础操作

    学习视频地址 https://cnodejs.org/topic/5a72c66ace45d440451465c3   初始化项目 首先查看项目中是否有package.json 文件,如果有可执行np ...

  5. JS-严格模式、非严格模式

    2018年11月14日晚上,我在“深入理解javascript”书上第一次知道“严格模式”“非严格模式”这2个名词: “严格模式”使用指令:“use strict”: 这个指令我其实有经常看到,在其他 ...

  6. 暂停时间 以及dict 循环

    暂停时间 #!/usr/bin/python # -*- coding: UTF-8 -*- import time myD = {1: 'a', 2: 'b'} for key, value in ...

  7. Linux运维:CentOS6和7的区别

    Liunx笔记:CentOS6和CentOS7的区别 路飞学城运维人员 在线流程图软件 Ago linux运维群: 93324526 笔者QQ:578843228 常用安装包下载 yum instal ...

  8. 常用jar包之commons-digester使用

    常用jar包之commons-digester使用 学习了:https://blog.csdn.net/terryzero/article/details/4332257 注意了, digester. ...

  9. Redis的安装和环境的搭建并设置服务(Redis学习笔记一)

    由于Redis在win上安装实在是太过于麻烦.我们选择把redis安装部署在linux上,然后远程连接. 安装Redis (1)cd /usr/src 进入下载目录 (1) yum install - ...

  10. Problem F

    Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) ...