maven profile
来源:互联网 发布:德阳数控铣床编程培训 编辑:程序博客网 时间:2024/06/05 12:46
profile
通过profile可以针对特定的环境来定制不同的artifact, 比如这样写来覆盖compile插件的默认配置:
使用profile的命令行用法:
mvn clean install -Pproduction -X
可以根据某种条件激活对应 profile, 比如根据jdk版本包含指定的模块:
activation元素列出了所有激活profile需要的条件, 比如下面的配置:
通过属性来激活:
可以将profile从pom.xml中拆分出来, 单独的放在profiles.xml文件中
除了可以在pom, pom外部设置profile外, 还可以在setting中设置profile, 可以将一些私密的信息设置在自己的settging.xml中
通过profile指定属性, 比如有一个envClassifier属性:
那么可以有这样的profile来指定一个envClassifier:
通过profile可以针对特定的环境来定制不同的artifact, 比如这样写来覆盖compile插件的默认配置:
- <profiles>#
- <profile>
- <id>production</id>#
- <build>#
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <debug>false</debug>#
- <optimize>true</optimize>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
使用profile的命令行用法:
mvn clean install -Pproduction -X
可以根据某种条件激活对应 profile, 比如根据jdk版本包含指定的模块:
- <profile>
- <id>jdk16</id>
- <activation>
- <jdk>1.6</jdk>
- </activation>
- <modules>
- <module>simple-script</module>
- </modules>
- </profile>
activation元素列出了所有激活profile需要的条件, 比如下面的配置:
- <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.5</value>
- </property>
- <file>
- <exists>file2.properties</exists>#
- <missing>file1.properties</missing>
- </file>
- </activation>
通过属性来激活:
- <activation>
- <property>
- <name>!environment.type</name>
- </property>
- </activation>
可以将profile从pom.xml中拆分出来, 单独的放在profiles.xml文件中
除了可以在pom, pom外部设置profile外, 还可以在setting中设置profile, 可以将一些私密的信息设置在自己的settging.xml中
通过profile指定属性, 比如有一个envClassifier属性:
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <classifier>${envClassifier}</classifier>
- </configuration>
- </plugin>
- </plugins>
- </build>
那么可以有这样的profile来指定一个envClassifier:
- <profile>
- <id>windows</id>
- <activation>
- <os>
- <family>windows</family>
- </os>
- </activation>
- <properties>
- <envClassifier>win</envClassifier>
- </properties>
- </profile>
0 0
- MAVEN Profile
- maven profile
- Maven profile
- Maven Profile
- maven profile
- Maven profile
- Maven Profile
- Maven profile整合Spring profile
- Maven profile整合Spring profile
- maven中的profile
- Maven之Profile详解
- Maven知识点记录 - profile
- maven profile样例
- maven spring profile
- Maven Profile介绍
- maven profile介绍
- maven之profile
- Maven Profile的使用
- android之OnTouchListener只能监听到ACTION_DOWN-----onTouchListener的返回值问题
- vc 隐藏进程
- IIS 部署MVC相关设置
- 专家详解伪造邮件攻击方法和防范措施
- QT 中的 collect2: ld returned 1 exit status 错误
- maven profile
- 开放地址法与链表法的优缺点及其实现
- Keil 的Configuration Wizard的编写
- cp如何拷贝完整路径
- Java版的Eval
- JSTL中C标签的简单用法(一)
- 技术人员应真正学会的第二课程
- oralce instr与 like 比较
- 谁卑微了谁的承诺