`
knight_black_bob
  • 浏览: 823210 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

maven 打包 方式 war tar.gz

阅读更多

 

tar.gz

 

assembly/sendper5minutes.xml

 <packaging>jar</packaging>

<assembly 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/assembly-1.0.0.xsd">
	<formats>
		<format>tar.gz</format>
	</formats>
	<dependencySets>
		<dependencySet>
			<useProjectArtifact>true</useProjectArtifact>
			<outputDirectory>lib</outputDirectory>
		</dependencySet>
	</dependencySets>
	<fileSets>
		<fileSet>
			<directory>lib</directory>
			<outputDirectory>lib</outputDirectory>
			<includes>
			</includes>
		</fileSet>
		<fileSet>
			<directory>src/main/resources</directory>
			<outputDirectory>conf</outputDirectory>
			<includes>  
				<include>applicationContext.xml</include>
				<include>elasticsearch.properties</include>
				<include>hbase-site.xml</include>
				<include>jdbc.properties</include>
				<include>log4j.xml</include>
				<include>rabbit-producer-context.xml</include>
				<include>rabbitmq.properties</include>
				<include>service.properties</include> 
			</includes>
		</fileSet>
		<fileSet>
			<directory>sh</directory>
			<outputDirectory>sh</outputDirectory>
			<includes> 
				<include>senddwrper5minutes.sh</include>
			</includes>
			<lineEnding>unix</lineEnding>
			<fileMode>0744</fileMode>
			<directoryMode>0644</directoryMode>
		</fileSet>
	</fileSets>
</assembly>

 

 assembly/war.xml

 

<assembly 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/assembly-1.0.0.xsd">
  <id>assembly</id>
  <formats>
    <format>war</format>
    <format>dir</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets> 
   <dependencySet>
      <outputDirectory>WEB-INF/lib</outputDirectory>
      <useProjectArtifact>false</useProjectArtifact>
    </dependencySet>    
  </dependencySets>
  <fileSets>
	<fileSet>
      <directory>${project.build.outputDirectory}</directory>
      <outputDirectory>WEB-INF/classes</outputDirectory>
    </fileSet> 
    <fileSet>
      <directory>src/main/assembly/bin</directory>
      <outputDirectory>WEB-INF/classes/lib</outputDirectory>
      <fileMode>0755</fileMode>
    </fileSet> 
    <fileSet>
      <directory>${project.basedir}/src/main/webapp</directory>
      <outputDirectory>/</outputDirectory>
    </fileSet>
  </fileSets>  
</assembly>

 

 

 

pom 

 

<packaging>war</packaging>

 

<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.2-beta-2</version>
				
				<executions>
				<execution>
						<id>make-tar.gz</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					<configuration>
					    <skipAssembly>false</skipAssembly> 
					    <appendAssemblyId>false</appendAssemblyId>
						<finalName>${project.artifactId}_senddwrper5minutes</finalName>
						<descriptors>
							<descriptorRef>assembly/sendper5minutes.xml</descriptorRef>
						</descriptors>
					</configuration> 
					</execution>
					<execution>
					    <id>make-war</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
						    <skipAssembly>false</skipAssembly> 
						    <appendAssemblyId>false</appendAssemblyId>
							<finalName>${project.artifactId}_maven_assembly_plugin</finalName>
							<descriptors>
								<descriptorRef>assembly/war.xml</descriptorRef>
							</descriptors>
							</configuration>
					</execution>
				</executions>
			</plugin> 

 以上 包含 assembly 打war  包

 

 

第二种 war 

 

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<packagingExcludes>
						WEB-INF/lib/servlet-api*.jar,WEB-INF/lib/jsp-api-*.jar,WEB-INF/lib/jsp-2.1-*.jar,WEB-INF/lib/*-7.0.54.jar,WEB-INF/lib/*-5.5.23.jar
					</packagingExcludes>
					<webResources>
						<resource>
							<directory>sql</directory>
							<includes>
								<include>self_helper/*.sql</include>
							</includes>
						</resource>
					</webResources>
				</configuration>
				<executions>
					<execution>
						<id>my-war</id>
						<phase>war</phase>
						<goals>
							<goal>war</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。



 
 
 谢谢您的赞助,我会做的更好!

 

 

 

 

 

0
0
分享到:
评论

相关推荐

    jenkins一键部署脚本包含jdk+maven环境.rar

    打包好的包邮`apache-tomcat-8.5.61.tar.gz` 、`apache-maven-3.5.4-bin.tar.gz`、`jdk-8u211-linux-x64.tar.gz` 、 `jenkins.war` 下载完毕后将脚本和 这些包放在/root/下运行即可 安装后 Jdk变量位置为:`/usr...

    Jenkins工具包

    工具包包含:(apache-maven-3.5.0-bin.tar.gz、apache-tomcat-7.0.75.tar.gz、git-2.9.3.tar.gz、jenkins.war),JDK8另行下载

    jenkins依赖包全家桶(maven、jdk、jenkins)

    apache-maven-3.8.4-bin.tar.gz jdk-8u311-linux-x64.tar.gz jenkins.war

    Maven build插件之Maven-assembly-plugin自定义打包

    ● 打包成指定格式分发包,支持各种主流的格式如zip、tar.gz、jar和war等,具体打包哪些文件是高度可控的。 ● 能够自定义包含/排除指定的目录或文件。 并附上了学习过程中应注意的细节,以及遇到的问题及解决方法...

    Maven常用插件整理.docx

    该插件允许用户整合项目的输出,包括依赖,模块,网站文档和其他...创建的文档格式包括:zip, tar, tar.gz(tgz), gar.bz2(tbgz2), jar, dir,war 等等。四种预定义的描述器可用:bin, jar-with-dependencies, src, project.

    linux搭建环境所需安装包.zip

    2.0-SNAPSHOT-jar-with-dependencies.jar,dubbo-admin的jar包dubbo-admin-0.0.1-SNAPSHOT.jar、dubbo-admin的war包dubbo-admin-2.5.8.war,maven安装包apache-maven-3.3.9-bin.tar.gz、tomcat安装包apache-...

    linux下搭建jenkins+git+maven+tomcat高可用集成

    压缩包内包括:git-2.8.0.tar.gz二进制安装包、jenkins.war应用服务war包、jenkins+git+maven+tomcat.docx搭建详细文档

    打jar包注意点.docx

    --打包的文件格式,也可以有:war zip--&gt; &lt;!--tar.gz压缩包下是否生成和项目名相同的根目录--&gt; &lt;includeBaseDirectory&gt;true &lt;!--是否把本项目添加到依赖文件夹下--&gt; &lt;useProjectArtifact&gt;false ...

    dubbox编译、环境搭建、服务提供和服务消费及学习资料

    zookeeper 安装包:zookeeper-3.4.6.tar.gz dubbo源码:dubbo-master-2.5.4-SNAPSHOT.zip dubbox源码:dubbox-master-2.8.4.zip源码 dubbo.xsd 文件:dubbo-opensesame-master-xsd-20170815.zip 服务提供和...

    Jenkins服务器安装与配置

    1.下载apache-maven-2.2.1-bin.tarhttp://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.tar.gz2.下载jenkins:http://mirrors.jenkins-ci.org/war/列出了jenkins的所有release版本,请选择...

    nmpb-projekt

    从网站下载camunde: ://camunda.org/release/camunda-bpm/jboss/7.1/camunda-bpm-jboss-7.1.0-Final.tar.gz 为 Eclipse (Kepler) 下载建模插件: : git 克隆 将项目导入eclipse(Kepler)——当我们要使用终端时 ...

    单点登录源码

    - 一站式支付解决方案,统一下单接口,支持支付宝、微信、网银等多种支付方式。不涉及业务的纯粹的支付平台。 - 统一下单(统一下单接口、统一扫码)、订单管理、数据分析、财务报表、商户管理、渠道管理、对账系统...

Global site tag (gtag.js) - Google Analytics