You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Alan Mehio (JIRA)" <ji...@codehaus.org> on 2007/09/25 13:05:11 UTC

[jira] Created: (MANTRUN-75) tasks if or unless does not work properly

tasks if or unless does not work properly 
------------------------------------------

                 Key: MANTRUN-75
                 URL: http://jira.codehaus.org/browse/MANTRUN-75
             Project: Maven 2.x Antrun Plugin
          Issue Type: Bug
         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
            Reporter: Alan Mehio


the below

<tasks unless="maven.test.skip">
                <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
              </tasks>


does not work from the example at  
http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html

The complete POM file ; please see below 


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">


	<modelVersion>4.0.0</modelVersion>
	<groupId>mygr</groupId>
	<artifactId>myartifact</artifactId>
	<packaging>pom</packaging>
	<version>1.1.0</version>
	<name>myartifact</name>
	<url>http://maven.apache.org</url>


	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<build>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>

			<!--  jar file plugin -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>./</classpathPrefix>
						</manifest>
					</archive>
				</configuration>
			</plugin>
			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<dependencies>
					<!--  why should we define  dependencies for the plugin -->
					<dependency>
						<groupId>commons-net</groupId>
						<artifactId>commons-net</artifactId>
						<version>1.4.1</version>
					</dependency>
					<dependency>
						<groupId>ant</groupId>
						<artifactId>ant-commons-net</artifactId>
						<version>1.6.5</version>
					</dependency>

				</dependencies>
				<executions>
					<execution>
						<id>install</id>
						<phase>install</phase>
						<configuration>


							<tasks unless="maven.test.skip">
								<echo
									message="To skip me, just call mvn -Dmaven.test.skip=true" />

								<echo
									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>


		</plugins>

	</build>

</project>

the command I run is 

mvn clean install -Dmaven.test.skip=true

it did not skip  the "tasks" and it always go through the tasks  
I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 

<tasks if="maven.project.alan.mehio.does.not.exit">
                <echo message="Does not skip the tasks "/>
</tasks>
it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 

Regards,
Alan Mehio
London, UK

              

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Teemu Lehto (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=138493#action_138493 ] 

Teemu Lehto commented on MANTRUN-75:
------------------------------------

Is it possible to rebuild plugin with ant 1.7.0 (see Carl's attachment) and release minor version (1.1.1 or something) ? I work for organization that will not allow changes to existing packages or plugins etc. 

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Carl Hall (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Hall updated MANTRUN-75:
-----------------------------

    Attachment: mantrun-75.diff

I rebuilt the plugin to use ant 1.7.0 (was 1.6.5) and the if/unless functionality appears to work as expected.

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139096#action_139096 ] 

Barrie Treloar commented on MANTRUN-75:
---------------------------------------

A work around is to use a profile:

  <profiles>
    <profile>
      <id>your-id-here</id>
      <activation>
        <property>
          <name>property-to-use-to-turn-on</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>your-execution-id-here</id>
                <phase>generate-resources</phase>
                <configuration>
                  <tasks>
                    <echo message="See profile work" />
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

Then to get this antrun profile use

mvn install -Dproperty-to-use-to-turn-on

which will enable this profile and hence run your antrun task.

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MANTRUN-75:
-----------------------------------

    Fix Version/s:     (was: 1.3)
                   1.2

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>            Assignee: Carlos Sanchez
>             Fix For: 1.2
>
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Carlos Sanchez (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Sanchez closed MANTRUN-75.
---------------------------------

      Assignee: Carlos Sanchez
    Resolution: Duplicate

>From my understanding the problem is that the docs reference 1.2 version that is not yet release, but it's on its way

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>            Assignee: Carlos Sanchez
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Carlos Sanchez (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlos Sanchez closed MANTRUN-75.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3

A vote has been called for 1.2 
documentation updated too

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>            Assignee: Carlos Sanchez
>             Fix For: 1.3
>
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Carl Hall (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=138244#action_138244 ] 

Carl Hall commented on MANTRUN-75:
----------------------------------

I've experienced the same problem on linux (ubuntu hardy), maven 2.0.9 and java 1.5.  I grabbed the code to the plugin and it appears that the properties are being set correctly on the antTasks object but that ant isn't honoring the if and unless fields once the call is handed off for task processing.

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139096#action_139096 ] 

baerrach edited comment on MANTRUN-75 at 6/20/08 12:19 AM:
-----------------------------------------------------------------

A work around is to use a profile:

{code:xml} 
  <profiles>
    <profile>
      <id>your-id-here</id>
      <activation>
        <property>
          <name>property-to-use-to-turn-on</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>your-execution-id-here</id>
                <phase>generate-resources</phase>
                <configuration>
                  <tasks>
                    <echo message="See profile work" />
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
{code} 

Then to get this antrun profile use

{code} mvn install -Dproperty-to-use-to-turn-on{code} 

which will enable this profile and hence run your antrun task.

      was (Author: baerrach):
    A work around is to use a profile:

  <profiles>
    <profile>
      <id>your-id-here</id>
      <activation>
        <property>
          <name>property-to-use-to-turn-on</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>your-execution-id-here</id>
                <phase>generate-resources</phase>
                <configuration>
                  <tasks>
                    <echo message="See profile work" />
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

Then to get this antrun profile use

mvn install -Dproperty-to-use-to-turn-on

which will enable this profile and hence run your antrun task.
  
> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg reopened MANTRUN-75:
------------------------------------


If the example requires a specific version of the plugin, then we must document that.

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>            Assignee: Carlos Sanchez
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTRUN-75) tasks if or unless does not work properly

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTRUN-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=141986#action_141986 ] 

Benjamin Bentmann commented on MANTRUN-75:
------------------------------------------

Maybe we should extend the Plugin Documentation Standard to require all POM snippets to have an appropriate {{<version>}} element? This would both teach best practices and avoid confusion.

> tasks if or unless does not work properly 
> ------------------------------------------
>
>                 Key: MANTRUN-75
>                 URL: http://jira.codehaus.org/browse/MANTRUN-75
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Win XP ( CYGWIN) JDK 1.5 update 7 
>            Reporter: Alan Mehio
>            Assignee: Carlos Sanchez
>         Attachments: mantrun-75.diff
>
>
> the below
> <tasks unless="maven.test.skip">
>                 <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
>               </tasks>
> does not work from the example at  
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/tasksAttributes.html
> The complete POM file ; please see below 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://vmaven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mygr</groupId>
> 	<artifactId>myartifact</artifactId>
> 	<packaging>pom</packaging>
> 	<version>1.1.0</version>
> 	<name>myartifact</name>
> 	<url>http://maven.apache.org</url>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 	</dependencies>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-compiler-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 				</configuration>
> 			</plugin>
> 			<!--  jar file plugin -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<configuration>
> 					<archive>
> 						<manifest>
> 							<addClasspath>true</addClasspath>
> 							<classpathPrefix>./</classpathPrefix>
> 						</manifest>
> 					</archive>
> 				</configuration>
> 			</plugin>
> 			<!--  anrrun plugin; this plugin as other the  two above will be inherited by the the children pom  -->
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-antrun-plugin</artifactId>
> 				<dependencies>
> 					<!--  why should we define  dependencies for the plugin -->
> 					<dependency>
> 						<groupId>commons-net</groupId>
> 						<artifactId>commons-net</artifactId>
> 						<version>1.4.1</version>
> 					</dependency>
> 					<dependency>
> 						<groupId>ant</groupId>
> 						<artifactId>ant-commons-net</artifactId>
> 						<version>1.6.5</version>
> 					</dependency>
> 				</dependencies>
> 				<executions>
> 					<execution>
> 						<id>install</id>
> 						<phase>install</phase>
> 						<configuration>
> 							<tasks unless="maven.test.skip">
> 								<echo
> 									message="To skip me, just call mvn -Dmaven.test.skip=true" />
> 								<echo
> 									message="Alan Mehio ---: project.build.finalName:  ${basedir}/build.xml" />
> 							</tasks>
> 						</configuration>
> 						<goals>
> 							<goal>run</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
> the command I run is 
> mvn clean install -Dmaven.test.skip=true
> it did not skip  the "tasks" and it always go through the tasks  
> I use the "if" attribute and it does not do any check for the property; it passes the validation eventhougth the property is not set 
> <tasks if="maven.project.alan.mehio.does.not.exit">
>                 <echo message="Does not skip the tasks "/>
> </tasks>
> it passes the check (if condition) event the property "maven.project.alan.mehio.does.not.exit" does not exist 
> Regards,
> Alan Mehio
> London, UK
>               

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira