通过属性激活 Maven 多项目配置文件

发布于 2024-12-29 00:58:56 字数 652 浏览 3 评论 0原文

我在激活个人资料时遇到问题。有一个带有配置文件的主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>
    ....

但是在构建过程中配置文件没有启动。

如果有人能帮助我,我会很高兴。

最好的问候,丹尼尔

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

jJeQQOZ5 2025-01-05 00:58:56

不幸的是,Maven 只能触发基于属性的配置文件,如果您从命令行将它们作为 JVM 参数传递:

mvn clean package -Dentityupdater.start

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文