maven的两种打包插件 ,防止 将无用文件打入META_INF,找不到主类的问题
第三种 打依赖包 将依赖其他jar的包都打进去
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/src.xml</descriptor>
</descriptors>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.13</version>
<configuration>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
可以直接声明主类
<!-- If you have classpath issue like NoDefClassError,... -->
<!-- useManifestOnlyJar>false</useManifestOnlyJar -->
<includes>
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
</includes>
</configuration>
</plugin> 第二种
<!--<plugin>-->
<!--<!– 将第三方的依赖包,一起打入到最终形成的jar文件中 –>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-shade-plugin</artifactId>-->
<!--<version>2.1</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>shade</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<transformers>-->
<!--<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">-->
<!--<mainClass>com.bigdata.bokong.offline.SmartAuditStat</mainClass>-->
<!--</transformer>-->
<!--</transformers>-->
<!--<!–<transformers>–>-->
<!--<!–<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">–>-->
<!--<!–<mainClass>com.wondertek.bigdata.offline.service.converter.server.DimensionConverterServer</mainClass>–>-->
<!--<!–</transformer>–>-->
<!--<!–</transformers>–>-->
<!--<!–<artifactSet>-->
<!--<includes>-->
<!--<include>cz.mallat.uasparser:uasparser</include>-->
<!--<include>net.sourceforge.jregex:jregex</include>-->
<!--<include>mysql:mysql-connector-java</include>-->
<!--</includes>-->
<!--</artifactSet>–>-->
<!--<filters>-->
<!--<filter>-->
<!--<artifact>*:*</artifact>-->
<!--<excludes>-->
<!--<exclude>META-INF/*.SF</exclude>-->
<!--<exclude>META-INF/*.DSA</exclude>-->
<!--<exclude>META-INF/*.RSA</exclude>-->
<!--</excludes>-->
<!--</filter>-->
<!--</filters>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
</plugins>
maven的两种打包插件 ,防止 将无用文件打入META_INF,找不到主类的问题的更多相关文章
- maven的两种打包方式
1.maven目前在web上面的使用方式很普遍,而打包的方式也存在很多方式 2.因为涉及一个项目调用另外一个项目的包,并将另外一个项目打成jar的形式便于管理 3.maven打包第一种方式: 将项目检 ...
- Springboot中IDE支持两种打包方式,即jar包和war包
Springboot中IDE支持两种打包方式,即jar包和war包 打包之前修改pom.xml中的packaging节点,改为jar或者war 在项目的根目录执行maven 命令clean pa ...
- 关于springboot项目的jar和war两种打包方式部署的区别
关于springboot项目的jar和war两种打包方式部署的区别 关于springboot项目的jar和war两种打包方式部署的区别? https://bbs.csdn.net/topics/392 ...
- IDEA中项目的两种打包方式
本文主要介绍在IDEA中怎么打包,及可以用哪种方式打包. 若是有指正或补充的,欢迎留言~ ٩(●̮̃•)۶ 接下来进入正题: IDEA中打包需要先进行配置,so,我们先打开<abbr titl ...
- springboot打包成jar包后找不到xml,找不到主类的解决方法
springboot打包成jar包后找不到xml,找不到主类的解决方法 请首先保证你的项目能正常运行(即不打包的时候运行无误),我们在打包时经常遇到如下问题: springboot打包成jar包后找不 ...
- maven 把spring项目打包成可执行的文件
转载自http://www.mamicod.e.com/info-detail-635726.html 最近需要解决Maven项目导入可执行的jar包的问题,如果项目不包含Spring,那么使用mvn ...
- 【maven】成功生成jar包,提示找不到主类?
问题描述: 使用maven构建zookeeper项目,完成一个简单的创建组的实例,代码调试完成,使用mvn clean install成功打包得到了jar包,但是在执行时发现使用java -cp ...
- Mybatis-plus的两种分页插件的配置方式
第一种: package com.paic.ocss.gateway.admin.config; import com.baomidou.mybatisplus.plugins.PaginationI ...
- MyEclipse10 中的两种FreeMarker插件的安装与配置
第一个插件是: freemarker-ide MyEclipce10.0中安装FreeMarker插件,这绝对是最简单的方法 ...
随机推荐
- 十四、JavaWeb监听器
JavaWeb监听器 三大组件: l Servlet l Listener l Filter Listener:监听器 初次相见:AWT 二次相见:SAX 监听器: l 它是一个接口,内容由我们来实现 ...
- JMter随记
线程组( Threads (Users))理解:一个虚拟用户组,线程组内线程数量在运行过程中不会发生改变. 注意事项:线程间变量相互独立. 一个测试计划内可以包含多个线程组. 可定义内容: 取样器错误 ...
- [转]BT原理分析
BitTorrent协议. BT全名为BitTorrent,是一个p2p软件,你在下载download的同时,也在为其他用户提供上传upload,因为大家是“互相帮助”,所以不会随着用户数的增加而降低 ...
- Python全栈-magedu-2018-笔记10
第三章 - Python 内置数据结构 集set 约定 set 翻译为集合 collection 翻译为集合类型,是一个大概念 set 可变的.无序的.不重复的元素的集合 set定义 初始化 set( ...
- MYSQL转换编码的解决方法
MYSQL转换编码的解决方法 一.在utf8的mysql下 得到中文‘游客’的gbk下的16进制编码 mysql> SELECT hex(CONVERT( '游客' USING gbk )); ...
- ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
约束字段为自动增长,被约束的字段必须同时被key约束 没有设置成primary key 时,会报错. 加上primary key 则设置成功.
- 数据结构优化dp
本以为自己的dp已经成熟了没想到在优化上面还是欠佳 或者是思路方面优化dp还不太行. 赤壁之战 当然 很有意思的题目描述 大体上是苦肉计吧 .盖黄 ... 题意是 求出长度为m的严格上升子序列的个数 ...
- Linux下进程和端口常用操作
https://blog.csdn.net/s573626822/article/details/80680456
- C#进度条简单应用
进度条表示文件复制的进度: 1.将进度条最大值设置为需要复制的文件总数 2.遍历文件时每复制一个文件之后,进度条+1 ;//文件总数 progressBar1.Value = progressBar1 ...
- 使用Gadget 做usb鼠标键盘设备
使用Gadget 做usb鼠标键盘设备 感谢TI社区提供的好帮助啊!http://e2e.ti.com/support/arm/sitara_arm/f/791/p/571771/2103409?pi ...