我目前工作的项目使用 maven 作为构建工具。对于正常构建,我们使用:
mvn clean install
但是为了为我们使用的某些特定服务器创建 EAR:
mvn clean install -Denvironment=SITE9003
以上命令引用项目中定义的特定过滤器属性文件,并相应地修改构建。
我的问题是 -Denvironment 究竟做了什么,它的配置在哪里?通过配置,我的意思是作为 -Denvironment 传递的参数的逻辑在哪里?
我试着查看“clean”和“install”插件的手册页,但没有找到任何关于 -Denvironment 的引用资料。
我们正在使用 Maven 2.2.1
最佳答案
Denvironment=test
触发名为 test
的 Maven 构建配置文件。
<profiles>
<profile>
<activation>
<property>
<name>environment</name>
<value>test</value>
</property>
</activation>
...
</profile>
</profiles>
This准确解释它;)
关于java - maven 中的 -Denvironment 选项是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22781399/