zoukankan      html  css  js  c++  java
  • 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>

  • 相关阅读:
    hdu--1026--Ignatius and the Princess I(bfs搜索+dfs(打印路径))
    hdu--1798--Doing Homework again(贪心)
    开启事务的两种方法
    事务的隔离级别,乐观锁,悲观锁
    树的结构,无限极关联
    微信小程序的加密解密以及小程序的支付
    微信小程序之登录连接django,以及用户的信息授权认证
    微信小程序三
    微信小程序二
    vue-cookies缓存
  • 原文地址:https://www.cnblogs.com/YuyuanNo1/p/7837833.html
Copyright © 2011-2022 走看看