maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Gesker <den...@gesker.com>
Subject maven-antrun-plugin questions
Date Fri, 19 Sep 2014 20:12:59 GMT
Hello List:

I could really use a couple of hints on this plugin with regard to ant
tasks within execution.

1. It it allowed to have two targets within an execution?
It seems that only the last target in the execution is run:


                   <execution>
                        <id>item1</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <!-- This does NOT Execute -->
                            <target name="checkOnWindows">
                                <condition property="isWindows"
value="true" else="false">
                                    <os family="windows" />
                                </condition>
                                <echo>${isWindows}</echo>
                            </target>
                            <!-- This DOES Execute -->
                            <target name="checkOnUnix">
                                <condition property="isUnix" value="true"
else="false">
                                    <os family="unix" />
                                </condition>
                                <echo>${isUnix}</echo>
                            </target>
                        </configuration>
                    </execution>


2. Ant tasks outside of a project (condition in this case) seem to be
ignored or not set:

                    <execution>
                        <id>item2</id>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <!-- This property does not seem to set -->
                            <condition property="isWindows" value="true"
else="false">
                                <os family="windows" />
                            </condition>
                            <!-- This displays as executed task -->
                            <target name="helloWorld" if="isWindows">
                                <!-- This is never reached -->
                                <echo>Hello World.</echo>
                            </target>
                        </configuration>
                    </execution>



I was going to try to use the <task> tags but I get a deprecated message.
Could someone offer some insight on the above scenarios.

JDK8_20, Ant_1.9.4

Dennis

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message