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配置的更多相关文章

  1. Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):4、Maven项目转换与pom.xml配置

    文章目录: Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):1.JIRA账号注册 Taurus.MVC-Java 版本打包上传到Maven中央仓库(详细过程):2.PGP ...

  2. maven项目板块的pom.xml配置

    项目名为helloweb 项目文件结构图1 helloweb>pom.xml内容如下: <project xmlns="http://maven.apache.org/POM/4 ...

  3. pom.xml配置,针对mvn clean install -P参数(环境参数)打包

    pom.xml配置,针对mvn clean install -P参数(环境参数)打包 比如你有2个环境,一个dev,一个prod, 然后你在mvn打包的时候,可以通过-P来打包,是打dev包,还是pr ...

  4. Maven-SSM项目pom.xml配置以及springmvc配置以及mybatis配置及web.xml配置

    一.Maven本地仓库的pom.xml配置 (全部是mysql数据库) <project xmlns="http://maven.apache.org/POM/4.0.0" ...

  5. Tomcat中的Server.xml配置详解

    Tomcat中的Server.xml配置详解 Tomcat Server的结构图如下: 该文件描述了如何启动Tomcat Server <Server> <Listener /> ...

  6. pom.xml 配置maven私服

    1.pom.xml 配置maven私服 <repositories>       <repository>        <id>caf_repositories& ...

  7. pom.xml配置引用项目时不生效

    1 在项目pom.xml配置中引用项目A,但是编译时,取提数引起是B: 2 原因是:[Java Build Path - Projects] 引用的还是老的项目B,删除该引用即可解决.

  8. maven+springboot项目使用idea打包

    首先简单了解一下maven: 概述 日常开发中,我们用到的maven相关功能大概以下几种: 1. 管理jar依赖 2. 构建项目(打包.编译等) 3. 发布项目(共享.上传至服务器,供他人使用) 简单 ...

  9. Maven项目pom.xml配置详解

    maven项目pom.xml文件配置详解,需要时可以用作参考: <project xmlns="http://maven.apache.org/POM/4.0.0" xmln ...

随机推荐

  1. Step download timeout (120 sec)

    Step download timeout (120 sec)  --------- Troubleshooting-----------------------------------    修改S ...

  2. ubuntu12.04开启虚拟机的unity模式

    终端中输入: sudo add-apt-repository ppa:gnome3-team/gnome3 sudo apt-get update sudo apt-get install gnome ...

  3. Spring RestTemplate 小结

    关于RestTemplate 首先,你可以把它理解为一个发起请求并接收响应的工具类(功能类似浏览器). 其次,它其实是一个壳,具体还是通过调用别的接口来实现(如jdk自带的连接,或者HttpClien ...

  4. ubuntu下android环境的搭建

    ---------省略1000字 https://dl-ssl.google.com/android/eclipse/  如果该方法被墙,直接下载最新ADT,在我的博客里有介绍,或者我已经上传百度网盘 ...

  5. VNC轻松连接远程Linux桌面(1)

    Linux平台安装VNCServer Windows平台使用VNC-Viewer 方法/步骤     在Linux平台安装VNCServer服务端软件包. #yum -y install vnc *v ...

  6. C++字符串类型和数字之间的转换

    转载:http://www.cnblogs.com/luxiaoxun/archive/2012/08/03/2621803.html 1.字符串数字之间的转换 字符串---字符数组(1)string ...

  7. mysql 中查看指定表的字段名 (可根据字段变量生成c#后台代码)

    select DISTINCT data_type  from COLUMNS where table_name='表名' 用ConCat();构造生成代码.....

  8. JavaSE(八)集合之List

    前面一篇的corejava讲的是集合的概述,这一篇我将详细的和大家讲解一下Collection下面的List.set.queue这三个子接口.希望大家能得到提升. 一.List接口 1.1.List接 ...

  9. linux(十一)之初始化文件

    前面写了很多linux的知识,其实很多都是命令的,所以要去多多的练习才能学的更好,加油为了好工作. 要么现在懒惰,未来讨饭.要么现在努力,未来惬意. 一.初始化文件概述 1.1.概述 系统初始化文件是 ...

  10. boa.config

    # boa -c /usr/local/boa Port 80 #User 0#Group 0 ErrorLog /dev/console AccessLog /dev/console ServerN ...