当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 3

nysyxxg/demo-maven-profile
关闭

forked from 俗人/demo-maven-profile 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pom.xml 2.60 KB
一键复制 编辑 原始数据 按行查看 历史
俗人 提交于 2018-10-18 19:03 . 调整规范目录结构
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jastar</groupId>
<artifactId>demo-maven-profile</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>demo-maven-profile Maven Webapp</name>
<url>http://www.jastar-wang.com</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<!-- 开发 -->
<profile>
<!-- profile的id -->
<id>dev</id>
<properties>
<!-- 此处的jastar.env可以自定义,其他地方可以使用${jastar.env}来引用此属性 -->
<jastar.env>dev</jastar.env>
</properties>
<activation>
<!-- 默认激活此配置 -->
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 测试 -->
<profile>
<id>test</id>
<properties>
<jastar.env>test</jastar.env>
</properties>
</profile>
<!-- 生产 -->
<profile>
<id>prd</id>
<properties>
<jastar.env>prd</jastar.env>
</properties>
</profile>
</profiles>
<build>
<finalName>demo-maven-profile</finalName>
<plugins>
<!-- 编译插件,此处用来设置jdk的版本,否则默认的版本很低 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- 资源文件处理插件,必须配置 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
<!-- 此处定义变量配置文件地址 -->
<filters>
<filter>src/main/filters/${jastar.env}/log4j.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<!-- 这句配置是关键,表示该资源文件夹下要进行过滤操作 -->
<filtering>true</filtering>
<!-- 其实还可以使用includes标签表示要包含哪些文件 -->
<!-- <includes>
<include>*</include>
</includes> -->
<!-- 也可以使用excludes标签表示要排除哪些文件 -->
<!-- <excludes>
<exclude>*.abc</exclude>
</excludes> -->
</resource>
<resource>
<directory>src/main/filters/${jastar.env}</directory>
</resource>
</resources>
</build>
</project>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/nysyxxg/demo-maven-profile.git
git@gitee.com:nysyxxg/demo-maven-profile.git
nysyxxg
demo-maven-profile
demo-maven-profile
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385