maven 生成可执行的jar文件
微服务的热潮,慢慢讲jar引入了码农的视线之中,从传统web开发中过来的人面对这个东西也算是个新鲜事了,接下来聊一聊在maven下生成可运行jar的那些事。
Maven可以使用mvn package
指令对项目进行打包生成jar文件,如果直接使用java -jar xxx.jar
指令运行jar文件,会出现”no main manifest attribute, in xxx.jar”(没有设置Main-Class)、ClassNotFoundException(找不到依赖包)等错误。
要想jar包能直接通过java -jar xxx.jar
运行,需要满足:
1、在jar包中的META-INF/MANIFEST.MF中指定Main-Class,这样才能确定程序的入口在哪里;
2、要能加载到依赖包。
1. 使用maven-shade-plugin插件打包,该插件在maven实战中推荐使用。
<build>
<plugins> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.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.xxg.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin> </plugins>
</build>
执行mvn package
即可打包。在target目录下会生成两个jar包,注意不是original-xxx.jar文件,而是另外一个,生成的jar文件包含了所有依赖,所以可以直接运行
不过如果项目中用到了Spring Framework,将依赖打到一个jar包中,运行时会出现读取XML schema文件出错。原因是Spring Framework的多个jar包中包含相同的文件spring.handlers和spring.schemas,如果生成单个jar包会互相覆盖。为了避免互相影响,可以使用AppendingTransformer
来对文件内容追加合并:
<build>
<plugins> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.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.xxg.Main</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>
2. 使用maven-assembly-plugin插件打包
<build>
<plugins> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<archive>
<manifest>
<mainClass>com.xxg.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin> </plugins>
</build> mvn package assembly:single
打包后会在target目录下生成一个xxx-jar-with-dependencies.jar
文件,这个文件不但包含了自己项目中的代码和资源,还包含了所有依赖包的内容。所以可以直接通过java -jar
来运行。
此外还可以直接通过mvn package
来打包,无需assembly:single
,不过需要加上一些配置:
<build>
<plugins> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<archive>
<manifest>
<mainClass>com.xxg.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin> </plugins>
</build>
其中<phase>package</phase>
、<goal>single</goal>
表示在执行package打包时,执行assembly:single
,所以可以直接使用mvn package
打包。
不过,如果项目中用到Spring Framework,用这种方式打出来的包运行时会出现读取XML schema文件异常等奇怪的错误,使用上面的方法可以处理。
3.使用maven-jar-plugin和maven-dependency-plugin插件打包
<build>
<plugins> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.xxg.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin> </plugins>
</build>
maven-jar-plugin用于生成META-INF/MANIFEST.MF文件的部分内容,<mainClass>com.xxg.Main</mainClass>
指定MANIFEST.MF中的Main-Class,<addClasspath>true</addClasspath>
会在MANIFEST.MF加上Class-Path项并配置依赖包,<classpathPrefix>lib/</classpathPrefix>
指定依赖包所在目录。
例如下面是一个通过maven-jar-plugin插件生成的MANIFEST.MF文件片段:
Class-Path: lib/commons-logging-1.2.jar lib/commons-io-2.4.jar
Main-Class: com.xxg.Main
不过仅仅生成MANIFEST.MF文件还不够,maven-dependency-plugin插件用于将依赖包拷贝到<outputDirectory>${project.build.directory}/lib</outputDirectory>
指定的位置,即lib目录下。
配置完成后,通过mvn package
指令打包,会在target目录下生成jar包,并将依赖包拷贝到target/lib目录下,目录结构如下:
目录结构
指定了Main-Class,有了依赖包,那么就可以直接通过java -jar xxx.jar
运行jar包。
不过这种方式生成jar包有个缺点,就是生成的jar包太多不便于管理,上边两种方式只生成单个jar文件,包含项目本身的代码、资源以及所有的依赖包。
4. assembly 引入配置式打包
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.5.3</version>
<outputDirectory>${project.build.directory}/dubbo</outputDirectory>
<includes>META-INF/assembly/**</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAToAAADJCAIAAAA8UWkIAAAUTklEQVR4nO2d+1MUV6LH5w/Z+7vuIxvKGMlsVg21D91KualUWf7mUm4VtXv1JnETY0DjEwiSeB3loQkmUhgwghJCwuRejDEuoAk+1nijgR1kZDQCwwADOjNnGLTvDz3MnD59uufB9Eyfnu+nuqyZ031ON05/OKdP09+xSQAAQbDl+gAAAMliiK7ByXv9dRt7q9f1Vq/rr9sYnLxnxF4AyDcM0fVi9Z9DPtfj0MTj0MSM59rl2o1G7AWAfCPzugZ97p6KFQ/6dkzfrHx4s9x/dfeDr7Z937D+Ss2LV2pevHHiL+FHvozvFIB8ILGuhJCEJTSXDv5h7EaD/07rrPvMrPvM7HCb39U67To94+6YcXf4bp/sr3tZd4fOEluUEidVZHc4HXabzWazO1yqLalCACyLnq7BYLC4uHj16tXFxcWxwunpabkkGAxya53btYyMO3WWc7uWae9TFjOqntMRfRX1MqbvQlFcUpfD4ZQAsDYJetfp6WnZ2Onp6djb4uJi+a0W3u9OjDSv9353QpIk15db+4+/1HO4qOdwUY+jqMdR9HXVc71H1vYeWdt75E9sTZfDrrRSxlnCyKqxHQCWJvFgOKao2+2m1dVhpHm9NP9/I83rJUkav36YjH5GRjvJaCcZ+5yMfUHGusi4c2qg6fyB1aqqLnnAywxuFX2uBFtBnpLUVJM8AH7hhReYgTEX7zfvkYE9Ly2xkYE93m8OSpJERprIyEni+Zh4momnhdw7NXmztrv69z73dX4TC87GFIWuAEjJzwxPT0/v2bMnYb8qSdJI8/qYrnIHS1y1ZKiODNWToaPkzjHf1XecFUUTw9cSNESNgFld1QUA5AEZvpEz8vlbk98Uk4E9Nz9cSQb2TF4o9nz+FrldSW6/Q25XkR8PePvKvij/nfeOhqsuR4li3jeqpNpOuQOOd7DOEnS2wPJkWtfm9Y+H903+842Xltgm//nG4zv7RprXt5cWtpcWni0t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E/X6KnPzyqVJIlNXWKz1aIPucYfXaU25/wNMfvMOvU4fPKtQVeQHYzS9ejbK2YCkSWb6pdsqt9+/OuZQGT78a/ltzOByNG3V2hVjP6NvjJglAkjVSRCqDKGo29jYmkFJ9J7pOvQsVDJtQZdQXYwUFff7NySTfXLt3y4fMuHvtk5+cWSTfW+2blEuqoCRqMlHC900puYprSlont0ze11WoOuIDsYqOvoFJG71iWb6g+dvRJ7Pe4PJ9CVE8sSH4myHSRVgZOhSDWlyBVmcDHfBZBaa9AVZAejdH13u13W9dDZK+t2tS7ZVL9uV6ss7egUeXe7XasidAVACwN19XijusqWxl54vIl0VSrJ+JhgMJyOrtE1zAbQFZgNo3Td/4/nPV7S0Tf87cDErZGZjr7hWyMz3w5MdPQNe7xk/z+e16rI+2Kb+Dt2Ile5NmnBtCaKVFNN0BWYCQN1dY+F3GOE+je+JNA19r1y3NsvinyX9IavcS3ZQCfq9wF0BWbDKF13vrZSf9GqiFMfAC1M9wAddAVAC+gKgDBAVwCE4f8BmT7+g7BqTd0AAAAASUVORK5CYII=" alt="" /> <assembly>
<id>assembly</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}/dubbo/META-INF/assembly/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/main/assembly/conf</directory>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAawAAAC8CAIAAACrCw3UAAAWM0lEQVR4nO2d248cx3XG++/JhYHhRaz0SyQiFygwnGCBPFLZp35IHCAG44simFLWokUxIt1cahVRFkFhlR3ZK0qiZG0zEB0RDlchTYm2LEBKgKa0EimYFMnlLml6t3kxJg89M12XU5funpme6vp+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Fk4ZIIGl1u6iKncXHYGzONSqIgiJLiYhin3L18Z9UkEsZJfnHwfRIx9yZiz6eT6gmE0gA+0ZRafdOux/WvsrkzOdAFYW9mbtdkLV5irA6i2K4qFMbQxaTLo08BgByXRNDoclMZk+sx3HJS3j17nwZdqdePkkjZ6YlE2I6dp8RFtUoq5TusbADX8eOE1hvNMKtniSBw/QhyQQQTOGOFrJkRHneFKETFWhUL0r8zjaMKKQCQ45IIGl1uKuKlcch3hDQOFR1Z6PLMVVMiknLwIw92DqhJSlzvZ6KpZpGMHV2jBsqmculaFEQ0iRcwJh26gu2rgjBVLAg5uGNqQJ8CADkuiaDR5SYdjZ/NCbMmQTSIwQ2jTrpE2A5J6JWoZoqkxJjFZ/VKGqMbvCBSENqhUSwyU+E/A5V1cUv1qrCb17MfxQQMKQCQ45IIGl1u0tG0C/GlRFCXSEkRVCRVRQQLK80aOGQRLG6Qx6PWImhbq8qruQCyU3qIICiBSyJodLmpiKfrC7YiaEyEu0bvGVj0TbUImmL1djtMfV6eIbLpWhRENLHYWaKrsXJVWIsgsUUCEQQlcEkEjS43VRGFbYpuGofEuKH/kRZBUyJER+dHRkxkdVIaEZRiJREnRWEUhcpRFW+YuE+h2fCVMyVFNOSzFoW1SlXQihzIV9mve/NriCAogUsiaHS5qYnLrT5Jr8h02Y8KETQkQr7DUaxRkeomJ6UTQTlRKTfzJgD31oiUDK0a3Hqb4rL2NZ1KVSEbw0WUJuX96JgOg5K4JIJGl5tNG6hh1G8I26bfGl0wbYMDYItLIugw49BAK21riwhaFxgAExDBkZDGoTgdHGWXtR8WtUQEW1IMMBFABEcFt5I2skGg8BMTMnN2uc119RB/1ANAbSCCAACv+X/5HnRyoRrLdgAAAABJRU5ErkJggg==" alt="" />
maven 生成可执行的jar文件的更多相关文章
- 使用Mavne生成可以执行的jar文件
到目前为之,还没有运行HelloWorld的项目,不要忘了HelloWorld类可是有一个main方法的.使用mvn clean install命令默认生成的jar 包是不能直接运行的.因为带有mai ...
- Maven 生成可执行的jar包
maven 默认打包生成的 jar 包是不能够直接运行的,因为带有 main 方法的类信息不会添加到 manifest 中,即打开 jar 文件中的 META-INF/MANIFEST.MF 文件,将 ...
- java中如何生成可执行的jar文件
java中如何生成可执行的jar文件 最简单的方法就是: jar -cfe Card.jar CardLayoutDemo CardLayoutDemo$1.class CardLayoutDemo$ ...
- IDEA生成可执行的jar文件
场景 用IDEA开发一个Java控制台程序,项目完成后,打包给客户使用. 做法 首先用IDEA打开要生成jar的项目,打开后选择File->Project Structure... 选择Arti ...
- 如何用jar命令生成可执行的jar文件
如果你已经把zh.java文件生成了zh.class文件 如果zh.class的路径是bin/com/zhang/zh.class 则在bin目录下放一个manifest.mf文件,文件内容如下: M ...
- 使用maven生成可执行的jar包
从pom的xsi中可以打开描述pom的schema: 可以看到pom中,project的结构: 默认的mvn install生成的jar是不带主类入口的,需要在maven-compile-plugin ...
- maven-jar-plugin 使用maven生成可执行的jar包install a test-jar in maven
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> ...
- 用eclipse来制作并使用可执行的jar文件
我近来用java写了一个股票收益分析的小程序,用于计算我的股票操作所带来的的收益.这里,记录了如何将源代码打包成可执行的命令的一个过程. 1:生成可执行的jar文件 选中工程,选择菜单中的export ...
- [Maven]Maven构建可执行的jar包(包含依赖jar包)
----------------------------------------------------------------- 原创博文,如需转载请注明出处! 博主:疲惫的豆豆 链接:http:/ ...
随机推荐
- SharePoint 2013 图文开发系列之创建内容类型
SharePoint内容类型,是很有特色的,就好比发布新闻,同在一张列表里,可以由内容类型区分图片新闻.文字新闻等,顾名思义,就是在一张列表里发布不同类型的项目. 1.添加新项目,选择SharePoi ...
- MyEclipse使用心得:SVN插件安装方法
1.在线安装,打开myeclipse,help--->MyEclipse Configuration Center 2.点击Add Site 打开对话框,在对话框Name输入Svn,URL中输入 ...
- Android—自定义标题栏的实现及遇见的问题解决
开发者设计界面时候往往不会使用系统自带的标题栏,因为不美观,所以需要自己设置标题栏. 1.根据需求在xml文件中设置标题布局 <?xml version="1.0" enco ...
- idea使用优化常用快捷键设置
1. 界面美观 1.1. 主题 1.2. 改Project面板大小 2. 快捷键 2.1智能提示 2.2常用快捷键 3.编辑器调整 3.1 代码提示忽略大小写 3.2 显示行号 3.3 优化自动导入 ...
- 了解HTML 元素分类
HTML中包含大量的标签, 这些标签在我们使用中发现会有小小的差别, 有的标签用了之后不会有太大的布局变化, 只是语义化, 而有的标签却会重起一行, 相当于自己回车了一次, 这就是不同标签元素的分类不 ...
- 网络天荒地老之UIWebView&WebKit
UIWebView 是苹果提供的用来展示网页的UI控件,它也是最占内存的控件. iOS8.0之后出现了webkit框架,WKWebView相比UIWebView节省了1/4~1/3的内存,速度快,但是 ...
- Shell 编程
Shell 是一门脚本语言(又称解释型语言),Shell 其实就是一个纯文本文件,通常以[#!/bin/bash]开始.脚本自上而下,从左至右分析并执行,其中[#]后面的为注释.脚本有以下几种运行方式 ...
- The process could not execute 'sp_repldone/sp_replcounters' on 'ServerName'
昨天发现发布服务器S(SQL Server 2008 R2),出现大量如下错误 错误细节如下所示: Date :: PM :: PM) Source spid52 Message Replicatio ...
- MongoDB学习笔记~MongoDBRepository仓储的实现
回到目录 仓储大叔,只要是持久化的东西,都要把它和仓储撤上关系,为啥,为的是开发人员在使用时统一,高可用及方便在各种方式之间实现动态的切换,如ef与redis和mongoDB的切换,你完成可以通过IR ...
- 看 nova-scheduler 如何选择计算节点 - 每天5分钟玩转 OpenStack(27)
本节重点介绍 nova-scheduler 的调度机制和实现方法:即解决如何选择在哪个计算节点上启动 instance 的问题. 创建 Instance 时,用户会提出资源需求,例如 CPU.内存.磁 ...