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. jQuery EasyUI教程之datagrid应用-2

    二.DataGrid的扩展应用 上一份教程我们创建的一个CRUD应用是使用对话框组件来增加或编辑用户信息.本教程将教你如何创建一个CRUD 数据表格(datagrid). 为了让这些CRUD功能正常工 ...

  2. SQLServer 跨库查询实现方法

    不使用链接的服务器名,而提供特殊的连接信息,并将其作为四部分对象名的一部分 本文给出一条 SQL 语句用于展示在同一名服务器上,不同的数据库间查询,注意当前连接用户要对两个库都有权限SQL Serve ...

  3. 有2个表,结构相似,有一个字段关联,现在怎么把A表的数据添加到B表中,条件是A表不在B表的数据?? 请各位高手多多指点,是oracle的数据库

    : insert into b(col1,col2 )select col1,col2 where not exists(select a.col1 from a where a.col1 = b.c ...

  4. e640. 使一个组件可拖动

    This example demonstrates the code needed to make a component draggable. The object being transferre ...

  5. linux -- 进程管理和作业控制

    一. 作业控制 1. 直接将命令放到后台"执行": &  [root @test /root ]# command & 范例: [root @test /root] ...

  6. apache -- xampp配置虚拟主机

    <VirtualHost *:80> ServerName www.myblog.com DocumentRoot "F:/Code/myblog"<Direct ...

  7. 其它系统与domino系统单点登录的实现方式

     其它系统与domino系统单点登录的实现方式 [背景] 随着企业中业务不断增多,用户处理不同的业务则须要频繁的切换不同的系统进行操作.而用户则须要记住各个系统的username.password ...

  8. c++ define的用法(转)

    #define是C语言中提供的宏定义命令,其主要目的是为程序员在编程时提供一定的方便,并能在一定程度上提高程序的运行效率,但学生在学习时往往不能 理解该命令的本质,总是在此处产生一些困惑,在编程时误用 ...

  9. 落实制度靠流程<摘自平安50万人的执行力>

     落实制度靠流程<摘自平安50万人的执行力> 讲在嘴上的制度是给人听的,写在纸上的制度是给人看的,落实在流程上的制度才是可靠的.制度的执行不能都依赖个人的自觉性. 很多企业都在强调和推行制 ...

  10. css之鼠标cursor

    <html> <body> <p>请把鼠标移动到单词上,可以看到鼠标指针发生变化:</p> <span style="cursor:au ...