maven指定项目的构建、打包和tomcat插件的pom.xml配置
1、pom.xml添加如下配置:
<build>
<finalName>${parent.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<uriEncoding>UT-8</uriEncoding>
<port>8088</port>
<path>/</path>
</configuration> </plugin> <!-- 打包插件, 便于部署 -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<descriptors>
<!-- 指定描述文件 -->
<descriptor>../assembly.xml</descriptor>
</descriptors>
<!-- 输出文件一定要放到项目根目录的target 目录下,
当前此插件在web子模块执行,其parent 才是项目根目录 -->
<outputDirectory>${project.parent.build.directory}</outputDirectory>
</configuration>
<executions>
<execution>
<id>packaging</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> 2、
assembly.xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> <!-- 与maven assembly plugin 配合使用 --> <id>assembly</id>
<!-- 使用项目名称 -->
<baseDirectory>/</baseDirectory>
<formats>
<!-- 压缩格式 -->
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<!-- web 项目 直接指定 打包目录
需要在web 模块的 pom 指定 finalName 为 项目名称
-->
<directory>target/${project.build.finalName}</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets> </assembly>
maven指定项目的构建、打包和tomcat插件的pom.xml配置的更多相关文章
- Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):4、Maven项目转换与pom.xml配置
文章目录: Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):1.JIRA账号注册 Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):2.PGP ...
- maven项目板块的pom.xml配置
项目名为helloweb 项目文件结构图1 helloweb>pom.xml内容如下: <project xmlns="http://maven.apache.org/POM/4 ...
- pom.xml配置,针对mvn clean install -P参数(环境参数)打包
pom.xml配置,针对mvn clean install -P参数(环境参数)打包 比如你有2个环境,一个dev,一个prod, 然后你在mvn打包的时候,可以通过-P来打包,是打dev包,还是pr ...
- Maven-SSM项目pom.xml配置以及springmvc配置以及mybatis配置及web.xml配置
一.Maven本地仓库的pom.xml配置 (全部是mysql数据库) <project xmlns="http://maven.apache.org/POM/4.0.0" ...
- Tomcat中的Server.xml配置详解
Tomcat中的Server.xml配置详解 Tomcat Server的结构图如下: 该文件描述了如何启动Tomcat Server <Server> <Listener /> ...
- pom.xml 配置maven私服
1.pom.xml 配置maven私服 <repositories> <repository> <id>caf_repositories& ...
- pom.xml配置引用项目时不生效
1 在项目pom.xml配置中引用项目A,但是编译时,取提数引起是B: 2 原因是:[Java Build Path - Projects] 引用的还是老的项目B,删除该引用即可解决.
- maven+springboot项目使用idea打包
首先简单了解一下maven: 概述 日常开发中,我们用到的maven相关功能大概以下几种: 1. 管理jar依赖 2. 构建项目(打包.编译等) 3. 发布项目(共享.上传至服务器,供他人使用) 简单 ...
- Maven项目pom.xml配置详解
maven项目pom.xml文件配置详解,需要时可以用作参考: <project xmlns="http://maven.apache.org/POM/4.0.0" xmln ...
随机推荐
- 第二百九十五节,python操作redis缓存-字符串类型
python操作redis缓存-字符串类型 首先要安装redis-py模块 python连接redis方式,有两种连接方式,一种是直接连接,一张是通过连接池连接 注意:以后我们都用的连接池方式连接,直 ...
- c++ 向main传递参赛
1.今天写了个批处理文件 准备向main传递参赛 发现在vs2008运行正常 vs2010运行只有首字母 2.需要在项目--属性--常规-字符集里面设置成多字节就好了,以前是unicode 3.因为 ...
- c++ _int64 转成string
_i64toa(a,buffer,10); scanf("%I64d",&a);printf("%I64d",a); 就可以正确输入输出了.当使用uns ...
- sftp,get命令使用*通配符的方式获取批量的文件
需求描述: 今天在使用sftp进行get文件的时候,有很多文件名类似的文件,以为还是需要一个一个get 后来发现get也可以使用通配符的方式进行匹配获取多个文件,在此记录下 操作过程: 1.通过sft ...
- angularjs基础——变量绑定
1)弄一个ng-app(angularjs 应用) 2)在里面用ng-model(angularjs 模型)就可以定义一个模型变量 3)使用模版方法就可以输出变量了(例如:{{name}}) 示例: ...
- MongoDB(一)-- 简介、安装、CRUD
一.Mongodb简介 MongoDB 是由C++语言编写的,是一个基于分布式文件存储的开源数据库系统. 在高负载的情况下,添加更多的节点,可以保证服务器性能. MongoDB 旨在为WEB应用提供可 ...
- UE4 Run On Server与Run on owning client
- CentOS 6.3下部署LVS(NAT模式)+keepalived实现高性能高可用负载均衡
一.简介 VS/NAT原理图: 二.系统环境 实验拓扑: 系统平台:CentOS 6.3 Kernel:2.6.32-279.el6.i686 LVS版本:ipvsadm-1.26 keepalive ...
- CentOs 设置静态IP 方法[测试没问题]
首先关闭VMware的DHCP: Edit->Virtual Network Editor 选择VMnet8,去掉Use local DHCP service to distribute IP ...
- Java创建数组的三种方法
■ 第一种: int[] arr=new int[6]; arr[0] = 1; arr[1] = 2 arr[2] = 3; arr[3] = 4; arr[4] = 5; arr[5] = 6; ...