You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Morgovsky, Alexander (US - Glen Mills)" <am...@deloitte.com> on 2006/12/05 18:30:28 UTC

Ant-Contrib foreach in Maven 2

I am trying to create an Ant task using the maven-antrun-plugin in Maven
2.  I would like to use the optional task foreach.  In Ant, I did this
by declaring the Ant-Contrib jar in a taskdef object in the build.xml.
How may I do this in Maven 2?  Thanks. 


This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law.  If you are not the intended recipient, you should delete this message. 


Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]

Re: Ant-Contrib foreach in Maven 2

Posted by Alexander Sack <pi...@gmail.com>.
Ah crap, beat me too it....what he said!  :D!  I use ant-contrib too for
other projects as well (exactly for the foreach target).

-aps

On 12/5/06, Haroon Rafique <ha...@utoronto.ca> wrote:
>
> On Today at 11:30am, MAUGM=>Morgovsky, Alexander (US - Glen Mills)...:
>
> AM> I am trying to create an Ant task using the maven-antrun-plugin in
> AM> Maven 2.  I would like to use the optional task foreach.  In Ant, I
> AM> did this by declaring the Ant-Contrib jar in a taskdef object in the
> AM> build.xml. How may I do this in Maven 2?  Thanks.
> AM>
> AM>
>
> I have the following in the <dependencies> section of my pom
>
>         <dependency>
>             <groupId>ant-contrib</groupId>
>             <artifactId>ant-contrib</artifactId>
>             <version>0.6</version>
>             <scope>provided</scope>
>         </dependency>
>
> then in my maven-antrun-plugin <tasks> section, I have the following:
>
>            <configuration>
>                <tasks>
>                    <taskdef
> resource="net/sf/antcontrib/antcontrib.properties"
>                             classpathref="maven.compile.classpath"/>
>                    ......
>                </tasks>
>            </configuration>
>
> Hope this helps.
> --
> Haroon Rafique
> <ha...@utoronto.ca>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson

Re: Ant-Contrib foreach in Maven 2

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/5/06, Haroon Rafique <ha...@utoronto.ca> wrote:

> I have the following in the <dependencies> section of my pom
>
>         <dependency>
>             <groupId>ant-contrib</groupId>
>             <artifactId>ant-contrib</artifactId>
>             <version>0.6</version>
>             <scope>provided</scope>
>         </dependency>

If this is something that is only needed at build time, it might be
more appropriate either as a <dependency> of the antrun plugin, or as
a <build><extensions><extension>.

(It's probably not hurting anything on the compile-time classpath, but
the less your compilation classpath differs from runtime, the better.)

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Ant-Contrib foreach in Maven 2

Posted by Haroon Rafique <ha...@utoronto.ca>.
On Today at 5:05pm, HR=>Haroon Rafique <ha...@utoronto.ca> wrote:

HR> I have the following in the <dependencies> section of my pom
HR> 
HR>         <dependency>
HR>             <groupId>ant-contrib</groupId>
HR>             <artifactId>ant-contrib</artifactId>
HR>             <version>0.6</version>
HR>             <scope>provided</scope>
HR>         </dependency>
HR> 

The maven2 official repos have the following versions:
	1.0b2
	20020829
I decided to put 0.6 in my internal repo (which is how maven finds it now 
in my project).

HR> 
HR> [..snip..]
HR> 

--
Haroon Rafique
<ha...@utoronto.ca>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Ant-Contrib foreach in Maven 2

Posted by Haroon Rafique <ha...@utoronto.ca>.
On Today at 11:30am, MAUGM=>Morgovsky, Alexander (US - Glen Mills)...:

AM> I am trying to create an Ant task using the maven-antrun-plugin in 
AM> Maven 2.  I would like to use the optional task foreach.  In Ant, I 
AM> did this by declaring the Ant-Contrib jar in a taskdef object in the 
AM> build.xml. How may I do this in Maven 2?  Thanks.
AM> 
AM> 

I have the following in the <dependencies> section of my pom

        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>0.6</version>
            <scope>provided</scope>
        </dependency>

then in my maven-antrun-plugin <tasks> section, I have the following:

           <configuration>
               <tasks>
                   <taskdef resource="net/sf/antcontrib/antcontrib.properties"           
                            classpathref="maven.compile.classpath"/>
                   ......
               </tasks>
           </configuration>

Hope this helps.
--
Haroon Rafique
<ha...@utoronto.ca>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org