maven pom.xml(二)
来源:互联网 发布:studio lee 类似 淘宝 编辑:程序博客网 时间:2024/05/16 04:41
<?xml version="1.0"?><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> //子项目中使用 <parent>指定,子项目继承父项目的大部分属性 //父项目的打包方式为pom 一般父项目定义jar包的版本,使子项目版本统一 <parent> <groupId>yeyi0909</groupId> <artifactId>fast-cms</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>fast-cms-core</artifactId> //打包方式 <packaging>war</packaging> <name>fast-cms-core</name> <url>http://maven.apache.org</url> <properties> <thymeleaf.version>3.0.6.RELEASE</thymeleaf.version> <thymeleaf-spring.version>3.0.6.RELEASE</thymeleaf-spring.version> <layout-dialect>2.1.2</layout-dialect> </properties> <dependencies> <dependency> <groupId>yeyi0909</groupId> <artifactId>fast-cms-common</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <!-- Thymeleaf begin--> <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf</artifactId> <version>${thymeleaf.version}</version> </dependency> <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring4</artifactId> <version>${thymeleaf-spring.version}</version> </dependency> <!-- Thymeleaf end--> <!-- Layout dialect begin--> <dependency> <groupId>nz.net.ultraq.thymeleaf</groupId> <artifactId>thymeleaf-layout-dialect</artifactId> <version>${layout-dialect}</version> </dependency> <!-- Layout dialect end--> </dependencies> <profiles> <-- maven-war-plugin将根据不同打包参数设置--> <--可以根据不同环境的配置文件--> <--开发环境:maven package –P dev profiles.active的值为dev--> <--生产环境:maven package –P online profiles.active的值为online -> <profile> <!-- 生产环境 --> <id>online</id> //默认profiles.active的值为online <properties> <profiles.active>online</profiles.active> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <!-- 本地开发环境 (测试环境)--> <id>dev</id> <properties> <profiles.active>dev</profiles.active> </properties> </profile> </profiles> <build> <!-- 这个是打包的时候生成的名字 --> <finalName>fast-cms</finalName> <resources> //过滤文件 <!-- class文件打包成war包,排除相关配置文件, --> <resource> <directory>src/main/resources</directory> <excludes> <exclude>dev/*</exclude> <exclude>online/*</exclude> </excludes> <filtering>true</filtering> </resource> </resources> <!-- 插件配置 --> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> <showWarnings>true</showWarnings> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <!-- 使用打包参数对应的配置文件设置项目对应的配置文件 --> <webResources> <resource> <!-- 根据不同环境profiles.active的值,编译不同的配置文件 --> <directory>src/main/resources/${profiles.active}</directory> <filtering>true</filtering> <targetPath>WEB-INF/classes</targetPath> </resource> </webResources> </configuration> </plugin> </plugins> <defaultGoal>compile</defaultGoal> </build></project>
阅读全文
0 0
- maven pom.xml(二)
- Maven的POM.xml详解(二)
- Maven的POM.xml详解(二)
- maven 配置篇 之pom.xml(二)
- maven 配置篇 之pom.xml(二)
- maven pom.xml配置详解二
- Maven项目管理实战(二)--pom.xml
- springMVC的maven pom.xml实例二
- 【maven】9、pom.xml介绍(二)
- Maven步步为营(二)POm
- pom.xml之(二)
- maven二 maven的pom.xml文件详解
- maven pom.xml详解(整理)
- Maven的POM.xml详解(一)
- Maven的POM.xml详解(四)
- 认识pom.xml(maven学习4)
- Maven的POM.xml详解(五)
- Maven实战(三)--Pom.xml详解
- LIS 求最长递增子序列
- Drools7.5.0教程(8)-workserver服务发布调用
- 扫描识别工具Dynamic Web TWAIN使用教程:属性/方法/事件介绍
- 在线报表设计实战系列 – ①准备数据源
- IDEA快捷键与使用技巧
- maven pom.xml(二)
- jdbc C3P0容错和自动重连
- 零散点整理[201709-11]
- js字符串常用方法
- 设计模式-抽象工厂模式
- 无法使用虚拟目录密码作为用户aspnet在本地登录到wwwroot
- 【linux】查看端口占用情况
- redis生成唯一id
- rabbitmq官方教程之发布与订阅(Publish/Subscribe)