通过属性激活Maven Multiproject配置文件 [英] Maven Multiproject Profile activation via property

查看:138
本文介绍了通过属性激活Maven Multiproject配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法激活个人资料.有一个配置文件的主pom:

 <profile>
    <id>EntityUpdater</id>
    <activation>
        <property>
            <name>entityupdater.start</name>
    <value>true</value>
        </property>
</activation>
    ....
 

在我的childpom(jar包)中,指定属性:

 <properties>
    <!-- ENTITY UPDATER CONFIG -->
    <entityupdater.start>true</entityupdater.start>
    ....
 

但是在构建过程中,配置文件无法启动.

如果有人能帮助我,我将非常高兴.

最诚挚的问候,丹尼尔

解决方案

不幸的是,Maven只能触发基于属性的配置文件,如果是从命令行作为JVM args传递的: /p>

mvn clean package -Dentityupdater.start

I have a problem to activate a profile. There is a master pom with the profile:

<profile>
    <id>EntityUpdater</id>
    <activation>
        <property>
            <name>entityupdater.start</name>
    <value>true</value>
        </property>
</activation>
    ....

In my childpom (jar package) I specify the property:

<properties>
    <!-- ENTITY UPDATER CONFIG -->
    <entityupdater.start>true</entityupdater.start>
    ....

But in the build process the profile does not start.

I would be very happy if anyone could help me.

Best regards, Daniel

解决方案

Unfortunately, Maven can only trigger property based profiles, if you are passing them in from the command-line as JVM args:

mvn clean package -Dentityupdater.start

这篇关于通过属性激活Maven Multiproject配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆