基于os系列的maven条件 [英] maven condition based on os family

查看:23
本文介绍了基于os系列的maven条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行以下操作:

I am trying to do the following:

                <execution>
                    <id>copy-jre</id>
                    <phase>package</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>com.sun</groupId>
                                <artifactId>jre</artifactId>
                                <version>${jdk.version}-${os.family}-x64</version>
                                <type>zip</type>
                            </artifactItem>                             
                        </artifactItems>
                        <outputDirectory>${target-deployer.cnc.dir}/java/${os.family}/x86_64/</outputDirectory>
                    </configuration>
                </execution>

在我的情况下,我想根据 os - windows 或 linux 复制依赖项.但是我找不到正确的参数

I want to copy dependency based on the os - windows or linux in my case. But I cant find the correct parameter

推荐答案

你可以使用profiles 这样做.

例如

<profile>
    <id>platform-windows</id>
    <activation>
        <os>
            <family>windows</family>
        </os>
    </activation>
    <build>
        <plugins>
            ...
        </plugins>
    </build>
</profile>

在您的情况下,您可能只想在配置文件的激活元素中指定 os/family.

In your case, you might just want to specify os/family in the profile's activation element.

这篇关于基于os系列的maven条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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