激活Maven profile的几种方式 http://juvenshun.iteye.com/blog/208714
profiles:
pom4.0的一个新特性就是具有根据environment来修改设置的能力
它包含可选的activation(profile的触发器)和一系列的changes。例如test过程可能会指向不同的数据库(相对最终的deployment)或者不同的dependencies或者不同的repositories,并且是根据不同的JDK来改变的。那么结构如下:
<profiles>
<profile>
<id>test</id>
<activation>...</activation>
<build>...</build>
<modules>...</modules>
<repositories>...</repositories>
<pluginRepositories>...</pluginRepositories>
<dependencies>...</dependencies>
<reporting>...</reporting>
<dependencyManagement>...</dependencyManagement>
<distributionManagement>...</distributionManagement>
</profile>
</profiles>
Activation:
触发这个profile的条件配置如下例:(只需要其中一个成立就可以激活profile,如果第一个条件满足了,那么后面就不会在进行匹配。
<profile>
<id>test</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>1.5</jdk>
<os>
<name>Windows XP</name>
<family>Windows</family>
<arch>x86</arch>
<version>5.1.2600</version>
</os>
<property>
<name>mavenVersion</name>
<value>2.0.3</value>
</property>
<file>
<exists>${basedir}/file2.properties</exists>
<missing>${basedir}/file1.properties</missing>
</file>
</activation>
激活profile的方法有多个:setting文件的activeProfile元素明确指定激活的profile的ID,在命令行上明确激活Profile用
-PprofileID 参数
查看某个build会激活的profile列表可以用:mvn help:active-profiles
分享到:
相关推荐
maven-profile-2.0.6.jar!!!
在maven中实现多环境的构建可移植性需要使用profile,通过不同的环境激活不同的profile来达到构建的可移植性。
maven项目转换为eclipse项目,可能缺少的包。
maven-profile-2.1.0.jar
maven-profile-2.0.2.jar
maven-profile-2.0.1.jar
注:下文中的 *** 代表文件名中的组件名称。 # 包含: 中文-英文对照文档:【***-javadoc-API文档-中文(简体)-英语-对照版.zip】 jar包下载地址:【***.jar下载地址(官方地址+国内镜像地址).txt】 Maven依赖:【*...
使用maven Profile实现多环境构建,详细请参考 :http://blog.csdn.net/u011781521/article/details/77899467
NULL 博文链接:https://hejiawangjava.iteye.com/blog/2280427
主要介绍了使用maven profile指定配置文件打包适用多环境的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包
java运行依赖jar包