Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven condition based on os family

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>

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

like image 833
archmisha Avatar asked Jan 22 '12 19:01

archmisha


1 Answers

You can use profiles to do this.

e.g.

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

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

like image 127
prunge Avatar answered Sep 18 '22 13:09

prunge