当我从命令行执行某些目标时,我想“自动”激活配置文件。
例如我现在在做什么:
mvn appengine:devserver -Pdevelopment
mvn appengine:update -Pproduction
基本上,我想在运行 devserver 目标时自动激活开发配置文件。 对于我在运行更新目标时要激活的生产配置文件也是如此(除非使用 -P 选项明确覆盖)。
这可能吗?
最佳答案
Maven Model告诉我们 the profile由各种元素组成,包括 build .如以下示例:-
<profile>
<id></id>
...
<build>
<plugins>
<plugin></plugin>
...
</plugins>
</build>
</profile>
正如我们在上面看到的,profile
控制着plugin
。那么你的问题的答案是否定的。我们不能让 plugin
激活 profile
。
希望这对您有所帮助。
关于google-app-engine - 如何根据正在执行的目标激活配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15964170/