1、pom.xml添加如下配置:

  1. <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>
  2.  
  3. </plugin>
  4.  
  5. <!-- 打包插件, 便于部署 -->
    <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>
  6.  
  7. 2、
  1. assembly.xml如下:
  1. <?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">
  2.  
  3. <!-- 与maven assembly plugin 配合使用 -->
  4.  
  5. <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>
  6.  
  7. </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. @RequestMapping @ResponseBody 和 @RequestBody 注解的用法与区别

    1.@RequestMapping 国际惯例先介绍什么是@RequestMapping,@RequestMapping 是一个用来处理请求地址映射的注解,可用于类或方法上.用于类上,表示类中的所有响应 ...

  2. zend opcache的最佳设置

    2016-01-21 在网上无意中看到的一篇文章,这哥们非常简洁地谈论了zend opcache的最佳设置,他说他为此花了大量的时间探索zend opcache的每个设置选项的细节,甚至是阅读它的源代 ...

  3. EasyUI项目中的自定义JS

    自定义方法: (function($) { $.extend($, { //获取下标,删除时使用 getArrayIndex :  function (array,value) { var index ...

  4. Bars, rectangles with bases on x-axis

    Usage geom_bar(mapping = NULL, data = NULL, stat = "bin", position = "stack", .. ...

  5. R语言学习笔记之<在Linux上遇到的问题集锦>

    Standalone模式:Standalone模式运行的Spark集群对不同的应用程序采用先进先出(FIFO)的顺序进行调度.默认情况下每个应用程序会独占所有可用节点的资源. 现在版本的SparkR只 ...

  6. C++ c++与C语言的区别(struct类型的加强,函数-变量类型加强,bool类型)

    //区别④:struct类型的加强(C++版本) #include<iostream> using namespace std; //C++中的struct是一个新类型的定义声明 //c+ ...

  7. 第二百九十三,Memcached缓存

    Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态.数据库驱动网站的速度.Memcached ...

  8. web开发之微信公众号---微信公众好开发

    --------------------------------------time:2015/11/5 ----------------------------------------------- ...

  9. 深入解析AsyncTask

    REFRENCES:http://blog.csdn.net/hitlion2008/article/details/7983449 AsyncTask的介绍及基本使用方法 关于AsyncTask的介 ...

  10. 基于Nginx反向代理及负载均衡

    基于Nginx反向代理及负载均衡 参考:http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass 只要没有被启用,默认就是 ...