You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mike Wallace <th...@yahoo.com> on 2009/02/11 21:51:16 UTC

Can maven-antrun-plugin run before code compiled?

I have a java project where the code depends on several libraries being built.
What I'd like to do is have Maven run an Ant task that builds those libraries first, then Maven would go on to compile the code.

Currently, my pom file contains the maven-antrun-plugin plugin that should execute the ant task.  However, when I run it, I get compile errors because I think it's trying to compile the java code first, but because the ant task hasn't been run yet, there are no libraries available and it will obviously fail.

This make sense?

Thanks,
Mike


      

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


Re: Can maven-antrun-plugin run before code compiled?

Posted by Mike Wallace <th...@yahoo.com>.
That's what I tried.  I dropped the jars files (created from the ant task in the process-resources phase) into target and also tried target/classes.

Either way, when the pom tried compiling the code, it still doesn't recognize them.  Is there a classpath that needs updating to include that target directory, or wherever I decide to drop them?


--- On Wed, 2/11/09, Mick Knutson <mi...@gmail.com> wrote:

> From: Mick Knutson <mi...@gmail.com>
> Subject: Re: Can maven-antrun-plugin run before code compiled?
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Wednesday, February 11, 2009, 7:21 PM
> Depends. What are you building? WAR? But basically, you
> could just copy them
> the wherever in your target DIR.
> 
> ---
> Thank You…
> 
> Mick Knutson, President
> 
> BASE Logic, Inc.
> Enterprise Architecture, Design, Mentoring & Agile
> Consulting
> p. (866) BLiNC-411: (254-6241-1)
> f. (415) 685-4233
> 
> Website: http://baselogic.com
> Linked IN: http://linkedin.com/in/mickknutson
> Twitter: http://twitter.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
> ---
> 
> 
> 
> On Wed, Feb 11, 2009 at 2:44 PM, Mike Wallace
> <th...@yahoo.com>wrote:
> 
> >
> > That did the trick.  Thanks!
> > Now that I have the ant task running and creating the
> required libraries,
> > how do I add them as a dependency in the pom file? 
> Those libraries are
> > getting created within the same project.  Is it a
> simple matter of just
> > copying them to the Target directory?
> >
> >
> > --- On Wed, 2/11/09, Mick Knutson
> <mi...@gmail.com> wrote:
> >
> > > From: Mick Knutson <mi...@gmail.com>
> > > Subject: Re: Can maven-antrun-plugin run before
> code compiled?
> > > To: "Maven Users List"
> <us...@maven.apache.org>,
> > the_real_brisco@yahoo.com
> > > Date: Wednesday, February 11, 2009, 4:50 PM
> > > This is the issue:
> > > *<phase>generate_libraries</phase>*
> > >
> > > This needs to be  maven standard phase you want
> this to run
> > > at. Like *
> > > generate-sources* would be an example. or
> > > *process-resources* which is just
> > > before compile.
> > >
> > > ---
> > > Thank You…
> > >
> > > Mick Knutson, President
> > >
> > > BASE Logic, Inc.
> > > Enterprise Architecture, Design, Mentoring &
> Agile
> > > Consulting
> > > p. (866) BLiNC-411: (254-6241-1)
> > > f. (415) 685-4233
> > >
> > > Website: http://baselogic.com
> > > Linked IN: http://linkedin.com/in/mickknutson
> > > Twitter: http://twitter.com/mickknutson
> > > Vacation Rental: http://tahoe.baselogic.com
> > > ---
> > >
> > >
> > >
> > > On Wed, Feb 11, 2009 at 4:22 PM, Mike Wallace
> > > <th...@yahoo.com>wrote:
> > >
> > > >
> > > >                <plugin>
> > > >
> > >
> <artifactId>maven-antrun-plugin</artifactId>
> > > >                        <executions>
> > > >                               
> <execution>
> > > >
> > > <id>build_xu</id>
> > > >
> > > <phase>generate_libraries</phase>
> > > >
> > > <configuration>
> > > >
> > > <tasks>
> > > >
> > > <property
> > > > refid="maven.compile.classpath"
> > > name="mvndepClasspath" />
> > > >
> > > <property
> > > > name="source"
> value="1.4"/>
> > > >
> > > <property
> > > > name="target"
> value="1.4"/>
> > > >
> > > <property
> > > > environment="env" />
> > > >
> > > >
> > > <taskdef
> > > >
> > >
> resource="net/sf/antcontrib/antcontrib.properties"
> > > > classpath="${mvndepClasspath}"
> />
> > > >
> > > >
> > > <condition
> > > > property="isWindows">
> > > >
> > >         <os
> > > > family="windows" />
> > > >
> > > </condition>
> > > >
> > > <condition
> > > > property="isUnix">
> > > >
> > >         <os
> > > > family="unix" />
> > > >
> > > </condition>
> > > >
> > > >
> > > <if>
> > > >
> > >         <equals
> > > > arg1="${isUnix}"
> arg2="true" />
> > > >
> > >         <then>
> > > >
> > > >  <property name="antPath"
> > > value="${env.ANT_HOME}/bin/ant"/>
> > > >
> > > >  <property name="jdkPath"
> > >
> value="${basedir}/../../../tools/unix/jdk160_05"/>
> > > >
> > >         </then>
> > > >
> > > </if>
> > > >
> > > <if>
> > > >
> > >         <equals
> > > > arg1="${isWindows}"
> arg2="true"
> > > />
> > > >
> > >         <then>
> > > >
> > > >  <property name="antPath"
> > >
> value="${env.ANT_HOME}/bin/ant.bat"/>
> > > >
> > > >  <property name="jdkPath"
> > > >
> > >
> value="${basedir}\..\..\..\tools\windows\jdk160_05"/>
> > > >
> > >         </then>
> > > >
> > > </if>
> > > >
> > > <echo>Compiling
> > > > client.exchangeutility using JDK:
> > > ${jdkPath}</echo>
> > > >
> > > <exec
> > > > dir="${basedir}"
> > > executable="${antPath}"
> > > failonerror="true">
> > > >
> > > >
> > >         <arg
> > > > line="build" />
> > > >
> > >         <env
> > > > key="JAVA_HOME"
> > > value="${jdkPath}"/>
> > > >
> > > </exec>
> > > >
> > > </tasks>
> > > >
> > > </configuration>
> > > >                                       
> <goals>
> > > >
> > > <goal>run</goal>
> > > >                                       
> </goals>
> > > >                               
> </execution>
> > > >                        </executions>
> > > >                </plugin>
> > > >
> > > >
> > > > --- On Wed, 2/11/09, Mick Knutson
> > > <mi...@gmail.com> wrote:
> > > >
> > > > > From: Mick Knutson
> <mi...@gmail.com>
> > > > > Subject: Re: Can maven-antrun-plugin
> run before
> > > code compiled?
> > > > > To: "Maven Users List"
> > > <us...@maven.apache.org>
> > > > > Date: Wednesday, February 11, 2009,
> 4:18 PM
> > > > > Please include your plugin setting?
> > > > >
> > > > > ---
> > > > > Thank You…
> > > > >
> > > > > Mick Knutson, President
> > > > >
> > > > > BASE Logic, Inc.
> > > > > Enterprise Architecture, Design,
> Mentoring &
> > > Agile
> > > > > Consulting
> > > > > p. (866) BLiNC-411: (254-6241-1)
> > > > > f. (415) 685-4233
> > > > >
> > > > > Website: http://baselogic.com
> > > > > Linked IN:
> http://linkedin.com/in/mickknutson
> > > > > Twitter: http://twitter.com/mickknutson
> > > > > Vacation Rental:
> http://tahoe.baselogic.com
> > > > > ---
> > > > >
> > > > >
> > > > >
> > > > > On Wed, Feb 11, 2009 at 3:51 PM, Mike
> Wallace
> > > > > <th...@yahoo.com>wrote:
> > > > >
> > > > > >
> > > > > > I have a java project where the
> code depends
> > > on
> > > > > several libraries being
> > > > > > built.
> > > > > > What I'd like to do is have
> Maven run an
> > > Ant task
> > > > > that builds those
> > > > > > libraries first, then Maven would
> go on to
> > > compile the
> > > > > code.
> > > > > >
> > > > > > Currently, my pom file contains
> the
> > > > > maven-antrun-plugin plugin that should
> > > > > > execute the ant task.  However,
> when I run
> > > it, I get
> > > > > compile errors because
> > > > > > I think it's trying to compile
> the java
> > > code
> > > > > first, but because the ant task
> > > > > > hasn't been run yet, there are
> no
> > > libraries
> > > > > available and it will obviously
> > > > > > fail.
> > > > > >
> > > > > > This make sense?
> > > > > >
> > > > > > Thanks,
> > > > > > Mike
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > > users-unsubscribe@maven.apache.org
> > > > > > For additional commands, e-mail:
> > > > > users-help@maven.apache.org
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail:
> > > users-help@maven.apache.org
> > > >
> > > >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > For additional commands, e-mail:
> users-help@maven.apache.org
> >
> >


      

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


Re: Can maven-antrun-plugin run before code compiled?

Posted by Mick Knutson <mi...@gmail.com>.
Depends. What are you building? WAR? But basically, you could just copy them
the wherever in your target DIR.

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Wed, Feb 11, 2009 at 2:44 PM, Mike Wallace <th...@yahoo.com>wrote:

>
> That did the trick.  Thanks!
> Now that I have the ant task running and creating the required libraries,
> how do I add them as a dependency in the pom file?  Those libraries are
> getting created within the same project.  Is it a simple matter of just
> copying them to the Target directory?
>
>
> --- On Wed, 2/11/09, Mick Knutson <mi...@gmail.com> wrote:
>
> > From: Mick Knutson <mi...@gmail.com>
> > Subject: Re: Can maven-antrun-plugin run before code compiled?
> > To: "Maven Users List" <us...@maven.apache.org>,
> the_real_brisco@yahoo.com
> > Date: Wednesday, February 11, 2009, 4:50 PM
> > This is the issue:
> > *<phase>generate_libraries</phase>*
> >
> > This needs to be  maven standard phase you want this to run
> > at. Like *
> > generate-sources* would be an example. or
> > *process-resources* which is just
> > before compile.
> >
> > ---
> > Thank You…
> >
> > Mick Knutson, President
> >
> > BASE Logic, Inc.
> > Enterprise Architecture, Design, Mentoring & Agile
> > Consulting
> > p. (866) BLiNC-411: (254-6241-1)
> > f. (415) 685-4233
> >
> > Website: http://baselogic.com
> > Linked IN: http://linkedin.com/in/mickknutson
> > Twitter: http://twitter.com/mickknutson
> > Vacation Rental: http://tahoe.baselogic.com
> > ---
> >
> >
> >
> > On Wed, Feb 11, 2009 at 4:22 PM, Mike Wallace
> > <th...@yahoo.com>wrote:
> >
> > >
> > >                <plugin>
> > >
> > <artifactId>maven-antrun-plugin</artifactId>
> > >                        <executions>
> > >                                <execution>
> > >
> > <id>build_xu</id>
> > >
> > <phase>generate_libraries</phase>
> > >
> > <configuration>
> > >
> > <tasks>
> > >
> > <property
> > > refid="maven.compile.classpath"
> > name="mvndepClasspath" />
> > >
> > <property
> > > name="source" value="1.4"/>
> > >
> > <property
> > > name="target" value="1.4"/>
> > >
> > <property
> > > environment="env" />
> > >
> > >
> > <taskdef
> > >
> > resource="net/sf/antcontrib/antcontrib.properties"
> > > classpath="${mvndepClasspath}" />
> > >
> > >
> > <condition
> > > property="isWindows">
> > >
> >         <os
> > > family="windows" />
> > >
> > </condition>
> > >
> > <condition
> > > property="isUnix">
> > >
> >         <os
> > > family="unix" />
> > >
> > </condition>
> > >
> > >
> > <if>
> > >
> >         <equals
> > > arg1="${isUnix}" arg2="true" />
> > >
> >         <then>
> > >
> > >  <property name="antPath"
> > value="${env.ANT_HOME}/bin/ant"/>
> > >
> > >  <property name="jdkPath"
> > value="${basedir}/../../../tools/unix/jdk160_05"/>
> > >
> >         </then>
> > >
> > </if>
> > >
> > <if>
> > >
> >         <equals
> > > arg1="${isWindows}" arg2="true"
> > />
> > >
> >         <then>
> > >
> > >  <property name="antPath"
> > value="${env.ANT_HOME}/bin/ant.bat"/>
> > >
> > >  <property name="jdkPath"
> > >
> > value="${basedir}\..\..\..\tools\windows\jdk160_05"/>
> > >
> >         </then>
> > >
> > </if>
> > >
> > <echo>Compiling
> > > client.exchangeutility using JDK:
> > ${jdkPath}</echo>
> > >
> > <exec
> > > dir="${basedir}"
> > executable="${antPath}"
> > failonerror="true">
> > >
> > >
> >         <arg
> > > line="build" />
> > >
> >         <env
> > > key="JAVA_HOME"
> > value="${jdkPath}"/>
> > >
> > </exec>
> > >
> > </tasks>
> > >
> > </configuration>
> > >                                        <goals>
> > >
> > <goal>run</goal>
> > >                                        </goals>
> > >                                </execution>
> > >                        </executions>
> > >                </plugin>
> > >
> > >
> > > --- On Wed, 2/11/09, Mick Knutson
> > <mi...@gmail.com> wrote:
> > >
> > > > From: Mick Knutson <mi...@gmail.com>
> > > > Subject: Re: Can maven-antrun-plugin run before
> > code compiled?
> > > > To: "Maven Users List"
> > <us...@maven.apache.org>
> > > > Date: Wednesday, February 11, 2009, 4:18 PM
> > > > Please include your plugin setting?
> > > >
> > > > ---
> > > > Thank You…
> > > >
> > > > Mick Knutson, President
> > > >
> > > > BASE Logic, Inc.
> > > > Enterprise Architecture, Design, Mentoring &
> > Agile
> > > > Consulting
> > > > p. (866) BLiNC-411: (254-6241-1)
> > > > f. (415) 685-4233
> > > >
> > > > Website: http://baselogic.com
> > > > Linked IN: http://linkedin.com/in/mickknutson
> > > > Twitter: http://twitter.com/mickknutson
> > > > Vacation Rental: http://tahoe.baselogic.com
> > > > ---
> > > >
> > > >
> > > >
> > > > On Wed, Feb 11, 2009 at 3:51 PM, Mike Wallace
> > > > <th...@yahoo.com>wrote:
> > > >
> > > > >
> > > > > I have a java project where the code depends
> > on
> > > > several libraries being
> > > > > built.
> > > > > What I'd like to do is have Maven run an
> > Ant task
> > > > that builds those
> > > > > libraries first, then Maven would go on to
> > compile the
> > > > code.
> > > > >
> > > > > Currently, my pom file contains the
> > > > maven-antrun-plugin plugin that should
> > > > > execute the ant task.  However, when I run
> > it, I get
> > > > compile errors because
> > > > > I think it's trying to compile the java
> > code
> > > > first, but because the ant task
> > > > > hasn't been run yet, there are no
> > libraries
> > > > available and it will obviously
> > > > > fail.
> > > > >
> > > > > This make sense?
> > > > >
> > > > > Thanks,
> > > > > Mike
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail:
> > > > users-help@maven.apache.org
> > > > >
> > > > >
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail:
> > users-help@maven.apache.org
> > >
> > >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Can maven-antrun-plugin run before code compiled?

Posted by Mike Wallace <th...@yahoo.com>.
That did the trick.  Thanks!
Now that I have the ant task running and creating the required libraries, how do I add them as a dependency in the pom file?  Those libraries are getting created within the same project.  Is it a simple matter of just copying them to the Target directory?


--- On Wed, 2/11/09, Mick Knutson <mi...@gmail.com> wrote:

> From: Mick Knutson <mi...@gmail.com>
> Subject: Re: Can maven-antrun-plugin run before code compiled?
> To: "Maven Users List" <us...@maven.apache.org>, the_real_brisco@yahoo.com
> Date: Wednesday, February 11, 2009, 4:50 PM
> This is the issue:
> *<phase>generate_libraries</phase>*
> 
> This needs to be  maven standard phase you want this to run
> at. Like *
> generate-sources* would be an example. or
> *process-resources* which is just
> before compile.
> 
> ---
> Thank You…
> 
> Mick Knutson, President
> 
> BASE Logic, Inc.
> Enterprise Architecture, Design, Mentoring & Agile
> Consulting
> p. (866) BLiNC-411: (254-6241-1)
> f. (415) 685-4233
> 
> Website: http://baselogic.com
> Linked IN: http://linkedin.com/in/mickknutson
> Twitter: http://twitter.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
> ---
> 
> 
> 
> On Wed, Feb 11, 2009 at 4:22 PM, Mike Wallace
> <th...@yahoo.com>wrote:
> 
> >
> >                <plugin>
> >                       
> <artifactId>maven-antrun-plugin</artifactId>
> >                        <executions>
> >                                <execution>
> >                                       
> <id>build_xu</id>
> >                                       
> <phase>generate_libraries</phase>
> >                                       
> <configuration>
> >                                               
> <tasks>
> >                                                       
> <property
> > refid="maven.compile.classpath"
> name="mvndepClasspath" />
> >                                                       
> <property
> > name="source" value="1.4"/>
> >                                                       
> <property
> > name="target" value="1.4"/>
> >                                                       
> <property
> > environment="env" />
> >
> >                                                       
> <taskdef
> >
> resource="net/sf/antcontrib/antcontrib.properties"
> > classpath="${mvndepClasspath}" />
> >
> >                                                       
> <condition
> > property="isWindows">
> >                                                       
>         <os
> > family="windows" />
> >                                                       
> </condition>
> >                                                       
> <condition
> > property="isUnix">
> >                                                       
>         <os
> > family="unix" />
> >                                                       
> </condition>
> >
> >                                                       
> <if>
> >                                                       
>         <equals
> > arg1="${isUnix}" arg2="true" />
> >                                                       
>         <then>
> >
> >  <property name="antPath"
> value="${env.ANT_HOME}/bin/ant"/>
> >
> >  <property name="jdkPath"
> value="${basedir}/../../../tools/unix/jdk160_05"/>
> >                                                       
>         </then>
> >                                                       
> </if>
> >                                                       
> <if>
> >                                                       
>         <equals
> > arg1="${isWindows}" arg2="true"
> />
> >                                                       
>         <then>
> >
> >  <property name="antPath"
> value="${env.ANT_HOME}/bin/ant.bat"/>
> >
> >  <property name="jdkPath"
> >
> value="${basedir}\..\..\..\tools\windows\jdk160_05"/>
> >                                                       
>         </then>
> >                                                       
> </if>
> >                                                       
> <echo>Compiling
> > client.exchangeutility using JDK:
> ${jdkPath}</echo>
> >                                                       
> <exec
> > dir="${basedir}"
> executable="${antPath}"
> failonerror="true">
> >
> >                                                       
>         <arg
> > line="build" />
> >                                                       
>         <env
> > key="JAVA_HOME"
> value="${jdkPath}"/>
> >                                                       
> </exec>
> >                                               
> </tasks>
> >                                       
> </configuration>
> >                                        <goals>
> >                                               
> <goal>run</goal>
> >                                        </goals>
> >                                </execution>
> >                        </executions>
> >                </plugin>
> >
> >
> > --- On Wed, 2/11/09, Mick Knutson
> <mi...@gmail.com> wrote:
> >
> > > From: Mick Knutson <mi...@gmail.com>
> > > Subject: Re: Can maven-antrun-plugin run before
> code compiled?
> > > To: "Maven Users List"
> <us...@maven.apache.org>
> > > Date: Wednesday, February 11, 2009, 4:18 PM
> > > Please include your plugin setting?
> > >
> > > ---
> > > Thank You…
> > >
> > > Mick Knutson, President
> > >
> > > BASE Logic, Inc.
> > > Enterprise Architecture, Design, Mentoring &
> Agile
> > > Consulting
> > > p. (866) BLiNC-411: (254-6241-1)
> > > f. (415) 685-4233
> > >
> > > Website: http://baselogic.com
> > > Linked IN: http://linkedin.com/in/mickknutson
> > > Twitter: http://twitter.com/mickknutson
> > > Vacation Rental: http://tahoe.baselogic.com
> > > ---
> > >
> > >
> > >
> > > On Wed, Feb 11, 2009 at 3:51 PM, Mike Wallace
> > > <th...@yahoo.com>wrote:
> > >
> > > >
> > > > I have a java project where the code depends
> on
> > > several libraries being
> > > > built.
> > > > What I'd like to do is have Maven run an
> Ant task
> > > that builds those
> > > > libraries first, then Maven would go on to
> compile the
> > > code.
> > > >
> > > > Currently, my pom file contains the
> > > maven-antrun-plugin plugin that should
> > > > execute the ant task.  However, when I run
> it, I get
> > > compile errors because
> > > > I think it's trying to compile the java
> code
> > > first, but because the ant task
> > > > hasn't been run yet, there are no
> libraries
> > > available and it will obviously
> > > > fail.
> > > >
> > > > This make sense?
> > > >
> > > > Thanks,
> > > > Mike
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail:
> > > users-help@maven.apache.org
> > > >
> > > >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > For additional commands, e-mail:
> users-help@maven.apache.org
> >
> >


      

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


Re: Can maven-antrun-plugin run before code compiled?

Posted by Mick Knutson <mi...@gmail.com>.
This is the issue:
*<phase>generate_libraries</phase>*

This needs to be  maven standard phase you want this to run at. Like *
generate-sources* would be an example. or *process-resources* which is just
before compile.

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Wed, Feb 11, 2009 at 4:22 PM, Mike Wallace <th...@yahoo.com>wrote:

>
>                <plugin>
>                        <artifactId>maven-antrun-plugin</artifactId>
>                        <executions>
>                                <execution>
>                                        <id>build_xu</id>
>                                        <phase>generate_libraries</phase>
>                                        <configuration>
>                                                <tasks>
>                                                        <property
> refid="maven.compile.classpath" name="mvndepClasspath" />
>                                                        <property
> name="source" value="1.4"/>
>                                                        <property
> name="target" value="1.4"/>
>                                                        <property
> environment="env" />
>
>                                                        <taskdef
> resource="net/sf/antcontrib/antcontrib.properties"
> classpath="${mvndepClasspath}" />
>
>                                                        <condition
> property="isWindows">
>                                                                <os
> family="windows" />
>                                                        </condition>
>                                                        <condition
> property="isUnix">
>                                                                <os
> family="unix" />
>                                                        </condition>
>
>                                                        <if>
>                                                                <equals
> arg1="${isUnix}" arg2="true" />
>                                                                <then>
>
>  <property name="antPath" value="${env.ANT_HOME}/bin/ant"/>
>
>  <property name="jdkPath" value="${basedir}/../../../tools/unix/jdk160_05"/>
>                                                                </then>
>                                                        </if>
>                                                        <if>
>                                                                <equals
> arg1="${isWindows}" arg2="true" />
>                                                                <then>
>
>  <property name="antPath" value="${env.ANT_HOME}/bin/ant.bat"/>
>
>  <property name="jdkPath"
> value="${basedir}\..\..\..\tools\windows\jdk160_05"/>
>                                                                </then>
>                                                        </if>
>                                                        <echo>Compiling
> client.exchangeutility using JDK: ${jdkPath}</echo>
>                                                        <exec
> dir="${basedir}" executable="${antPath}" failonerror="true">
>
>                                                                <arg
> line="build" />
>                                                                <env
> key="JAVA_HOME" value="${jdkPath}"/>
>                                                        </exec>
>                                                </tasks>
>                                        </configuration>
>                                        <goals>
>                                                <goal>run</goal>
>                                        </goals>
>                                </execution>
>                        </executions>
>                </plugin>
>
>
> --- On Wed, 2/11/09, Mick Knutson <mi...@gmail.com> wrote:
>
> > From: Mick Knutson <mi...@gmail.com>
> > Subject: Re: Can maven-antrun-plugin run before code compiled?
> > To: "Maven Users List" <us...@maven.apache.org>
> > Date: Wednesday, February 11, 2009, 4:18 PM
> > Please include your plugin setting?
> >
> > ---
> > Thank You…
> >
> > Mick Knutson, President
> >
> > BASE Logic, Inc.
> > Enterprise Architecture, Design, Mentoring & Agile
> > Consulting
> > p. (866) BLiNC-411: (254-6241-1)
> > f. (415) 685-4233
> >
> > Website: http://baselogic.com
> > Linked IN: http://linkedin.com/in/mickknutson
> > Twitter: http://twitter.com/mickknutson
> > Vacation Rental: http://tahoe.baselogic.com
> > ---
> >
> >
> >
> > On Wed, Feb 11, 2009 at 3:51 PM, Mike Wallace
> > <th...@yahoo.com>wrote:
> >
> > >
> > > I have a java project where the code depends on
> > several libraries being
> > > built.
> > > What I'd like to do is have Maven run an Ant task
> > that builds those
> > > libraries first, then Maven would go on to compile the
> > code.
> > >
> > > Currently, my pom file contains the
> > maven-antrun-plugin plugin that should
> > > execute the ant task.  However, when I run it, I get
> > compile errors because
> > > I think it's trying to compile the java code
> > first, but because the ant task
> > > hasn't been run yet, there are no libraries
> > available and it will obviously
> > > fail.
> > >
> > > This make sense?
> > >
> > > Thanks,
> > > Mike
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail:
> > users-help@maven.apache.org
> > >
> > >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Can maven-antrun-plugin run before code compiled?

Posted by Mike Wallace <th...@yahoo.com>.
		<plugin>
			<artifactId>maven-antrun-plugin</artifactId>
			<executions>
				<execution>
					<id>build_xu</id>
					<phase>generate_libraries</phase>
					<configuration>
						<tasks>
							<property refid="maven.compile.classpath" name="mvndepClasspath" />
							<property name="source" value="1.4"/>
							<property name="target" value="1.4"/>
							<property environment="env" />
							
							<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${mvndepClasspath}" />
							
							<condition property="isWindows">
								<os family="windows" />
							</condition>
							<condition property="isUnix">
								<os family="unix" />
							</condition>

							<if>
								<equals arg1="${isUnix}" arg2="true" />
								<then>
									<property name="antPath" value="${env.ANT_HOME}/bin/ant"/>
									<property name="jdkPath" value="${basedir}/../../../tools/unix/jdk160_05"/>
								</then>
							</if>
							<if>
								<equals arg1="${isWindows}" arg2="true" />
								<then>
									<property name="antPath" value="${env.ANT_HOME}/bin/ant.bat"/>
									<property name="jdkPath" value="${basedir}\..\..\..\tools\windows\jdk160_05"/>
								</then>
							</if>
							<echo>Compiling client.exchangeutility using JDK: ${jdkPath}</echo>
							<exec dir="${basedir}" executable="${antPath}" failonerror="true">

								<arg line="build" />
								<env key="JAVA_HOME" value="${jdkPath}"/>
							</exec>
						</tasks>
					</configuration>
					<goals>
						<goal>run</goal>
					</goals>
				</execution>
			</executions>
		</plugin>


--- On Wed, 2/11/09, Mick Knutson <mi...@gmail.com> wrote:

> From: Mick Knutson <mi...@gmail.com>
> Subject: Re: Can maven-antrun-plugin run before code compiled?
> To: "Maven Users List" <us...@maven.apache.org>
> Date: Wednesday, February 11, 2009, 4:18 PM
> Please include your plugin setting?
> 
> ---
> Thank You…
> 
> Mick Knutson, President
> 
> BASE Logic, Inc.
> Enterprise Architecture, Design, Mentoring & Agile
> Consulting
> p. (866) BLiNC-411: (254-6241-1)
> f. (415) 685-4233
> 
> Website: http://baselogic.com
> Linked IN: http://linkedin.com/in/mickknutson
> Twitter: http://twitter.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
> ---
> 
> 
> 
> On Wed, Feb 11, 2009 at 3:51 PM, Mike Wallace
> <th...@yahoo.com>wrote:
> 
> >
> > I have a java project where the code depends on
> several libraries being
> > built.
> > What I'd like to do is have Maven run an Ant task
> that builds those
> > libraries first, then Maven would go on to compile the
> code.
> >
> > Currently, my pom file contains the
> maven-antrun-plugin plugin that should
> > execute the ant task.  However, when I run it, I get
> compile errors because
> > I think it's trying to compile the java code
> first, but because the ant task
> > hasn't been run yet, there are no libraries
> available and it will obviously
> > fail.
> >
> > This make sense?
> >
> > Thanks,
> > Mike
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > For additional commands, e-mail:
> users-help@maven.apache.org
> >
> >


      

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


Re: Can maven-antrun-plugin run before code compiled?

Posted by Mick Knutson <mi...@gmail.com>.
Please include your plugin setting?

---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---



On Wed, Feb 11, 2009 at 3:51 PM, Mike Wallace <th...@yahoo.com>wrote:

>
> I have a java project where the code depends on several libraries being
> built.
> What I'd like to do is have Maven run an Ant task that builds those
> libraries first, then Maven would go on to compile the code.
>
> Currently, my pom file contains the maven-antrun-plugin plugin that should
> execute the ant task.  However, when I run it, I get compile errors because
> I think it's trying to compile the java code first, but because the ant task
> hasn't been run yet, there are no libraries available and it will obviously
> fail.
>
> This make sense?
>
> Thanks,
> Mike
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>