You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by halsafar <sh...@gmail.com> on 2008/06/04 23:49:12 UTC

Ant Task - Build maven pom.xml

I am trying to write an ant script to automate some maven tasks and hopefully
decide not to rebuild the entire thing if it detects no changes.  Just to
give an idea I am working with Jasig CAS Server which has several modules
all which are Maven projects.  The build time is brutal on this beast and it
will always rebuild no matter what it seems.  So even if Ant won't help I am
still stuck using Ant as I need to auto-deploy the CAS Server to both a
Tomcat and Glassfish server.  Now everything has been done and Maven is
being run from a simple <exec> call in the build.xml for the ant script.  I
did find some Official Maven Ant Tasks jar I would like to try.  However I
have been unable to find any examples which actually show this maven ant
tasks   building a maven project.  Any help?
-- 
View this message in context: http://www.nabble.com/Ant-Task---Build-maven-pom.xml-tp17657445p17657445.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Ant Task - Build maven pom.xml

Posted by Hervé BOUTEMY <he...@free.fr>.
Le mercredi 11 février 2009, vikask a écrit :
> Hi,
> Thanks for you detailed explanation. I got the scope of "maven ant tasks".
> case 1 is what I am looking for.
great
what is missing in the doc? what do you feel should be improved?

> Definitely now I will try with <exec> ant task.
If I understand this comment, you're really wanting to build the project: yes, 
<exec executable="mvn"> is the way to do it, not Maven Ant Tasks

>
> Just for curiosity, Is there any plan to in maven 3 to give such facility
> to build any maven (pom.xml) project from ant build.xml file?
no, Maven Ant Tasks are rewritten within Mercury (won't explain here the 
difference, that's not useful), but the scope doesn't change: only 
dependencies and install/deploy.
In fact, I don't understand the use case: if full Maven power is needed, just 
use Maven, not Ant, no?
Implementing such tasks would be equivalent as writing a replacement to Maven 
CLI, to avoid <exec executable="mvn"><arg >* but having a wrapper doing some 
equivalent work. I really don't understand.

>
> Thanks once again for your great explanation.
please help me improve the doc :)

regards,

Hervé

>
> regards
> Vikas
>
> Hervé BOUTEMY wrote:
> > Hi,
> >
> > I thought Tim's reply didn't need any addition, but it seems that even
> > the documentation is still not clear enough (multiple people did a lot of
> > work on
> > it, though...).
> > Let's try to understand your problem, then improve the doc.
> >
> > Perhaps 2 examples will help us to understand each other.
> >
> > 1. Maven Ant Tasks have a sample.build.xml [2] to unit-test the
> > components features
> > As stated before, Maven Ant Tasks are not meant to really *build* a
> > project,
> > but only get dependencies. So you won't see in this example anything
> > really
> > building: only getting dependencies in multiple forms, installing an
> > artifact
> > into local repository and deploying to a remote repo (how the artifact
> > installed/deployed is really build is not shown, since once again, it's
> > not
> > the purpose of the tasks)
> >
> > 2. Maven itself can be bootstrapped using Maven Ant Tasks: see build.xml
> > in
> > Maven Core sources [3]
> > This time, this is really a project (Maven Core) built by Ant, getting
> > its multiple dependencies with Maven Ant Tasks: seems to be what you want
> > to do
> > with your project.
> > As you can see in the build file, most content is about building a
> > specific
> > project: there is only a little part that is about getting dependencies,
> > ie
> > the "pull" target (with its depends).
> >
> >
> > Are these examples more clear?
> >
> >
> > Regards,
> >
> > Hervé
> >
> >
> > [2]
> > http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0
> >.x/sample.build.xml?view=markup
> >
> > [3]
> > http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/build.
> >xml?view=markup
> >
> > Le mercredi 11 février 2009, vikask a écrit :
> >> Hi
> >>
> >> I am also facing same problem. Have anyone found solution?
> >>
> >> Thanks
> >>
> >> regards
> >> Vikas
> >>
> >> Tim Kettler wrote:
> >> > Hi,
> >> >
> >> > halsafar schrieb:
> >> >> I am trying to write an ant script to automate some maven tasks and
> >> >> hopefully
> >> >> decide not to rebuild the entire thing if it detects no changes. 
> >> >> Just to give an idea I am working with Jasig CAS Server which has
> >> >> several modules all which are Maven projects.  The build time is
> >> >> brutal on
> >>
> >> this
> >>
> >> >> beast and it
> >> >> will always rebuild no matter what it seems.  So even if Ant won't
> >>
> >> help
> >>
> >> >> I am
> >> >> still stuck using Ant as I need to auto-deploy the CAS Server to both
> >>
> >> a
> >>
> >> >> Tomcat and Glassfish server.  Now everything has been done and Maven
> >>
> >> is
> >>
> >> >> being run from a simple <exec> call in the build.xml for the ant
> >>
> >> script.
> >>
> >> >> I
> >> >> did find some Official Maven Ant Tasks jar I would like to try.
> >>
> >> However
> >>
> >> >> I
> >> >> have been unable to find any examples which actually show this maven
> >>
> >> ant
> >>
> >> >> tasks   building a maven project.  Any help?
> >> >
> >> > The maven ant tasks bring the dependency management features of maven
> >>
> >> to
> >>
> >> > ant, they don't enable ant to build a maven project. Anyway, here [1]
> >>
> >> is
> >>
> >> > the link to the official homepage containing usage instructions.
> >> >
> >> > -Tim
> >> >
> >> > [1] http://maven.apache.org/ant-tasks.html
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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: Ant Task - Build maven pom.xml

Posted by vikask <vi...@aikonlabs.com>.
Hi,
Thanks for you detailed explanation. I got the scope of "maven ant tasks".
case 1 is what I am looking for.
Definitely now I will try with <exec> ant task.

Just for curiosity, Is there any plan to in maven 3 to give such facility to
build any maven (pom.xml) project from ant build.xml file?

Thanks once again for your great explanation.

regards
Vikas


Hervé BOUTEMY wrote:
> 
> Hi,
> 
> I thought Tim's reply didn't need any addition, but it seems that even the 
> documentation is still not clear enough (multiple people did a lot of work
> on 
> it, though...).
> Let's try to understand your problem, then improve the doc.
> 
> Perhaps 2 examples will help us to understand each other.
> 
> 1. Maven Ant Tasks have a sample.build.xml [2] to unit-test the components 
> features
> As stated before, Maven Ant Tasks are not meant to really *build* a
> project, 
> but only get dependencies. So you won't see in this example anything
> really 
> building: only getting dependencies in multiple forms, installing an
> artifact 
> into local repository and deploying to a remote repo (how the artifact 
> installed/deployed is really build is not shown, since once again, it's
> not 
> the purpose of the tasks)
> 
> 2. Maven itself can be bootstrapped using Maven Ant Tasks: see build.xml
> in 
> Maven Core sources [3]
> This time, this is really a project (Maven Core) built by Ant, getting its 
> multiple dependencies with Maven Ant Tasks: seems to be what you want to
> do 
> with your project.
> As you can see in the build file, most content is about building a
> specific 
> project: there is only a little part that is about getting dependencies,
> ie 
> the "pull" target (with its depends).
> 
> 
> Are these examples more clear?
> 
> 
> Regards,
> 
> Hervé
> 
> 
> [2] 
> http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/sample.build.xml?view=markup
> 
> [3] 
> http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/build.xml?view=markup
> 
> Le mercredi 11 février 2009, vikask a écrit :
>> Hi
>>
>> I am also facing same problem. Have anyone found solution?
>>
>> Thanks
>>
>> regards
>> Vikas
>>
>> Tim Kettler wrote:
>> > Hi,
>> >
>> > halsafar schrieb:
>> >> I am trying to write an ant script to automate some maven tasks and
>> >> hopefully
>> >> decide not to rebuild the entire thing if it detects no changes.  Just
>> >> to give an idea I am working with Jasig CAS Server which has several
>> >> modules all which are Maven projects.  The build time is brutal on
>> this
>> >> beast and it
>> >> will always rebuild no matter what it seems.  So even if Ant won't
>> help
>> >> I am
>> >> still stuck using Ant as I need to auto-deploy the CAS Server to both
>> a
>> >> Tomcat and Glassfish server.  Now everything has been done and Maven
>> is
>> >> being run from a simple <exec> call in the build.xml for the ant
>> script.
>> >> I
>> >> did find some Official Maven Ant Tasks jar I would like to try. 
>> However
>> >> I
>> >> have been unable to find any examples which actually show this maven
>> ant
>> >> tasks   building a maven project.  Any help?
>> >
>> > The maven ant tasks bring the dependency management features of maven
>> to
>> > ant, they don't enable ant to build a maven project. Anyway, here [1]
>> is
>> > the link to the official homepage containing usage instructions.
>> >
>> > -Tim
>> >
>> > [1] http://maven.apache.org/ant-tasks.html
>> >
>> > ---------------------------------------------------------------------
>> > 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ant-Task---Build-maven-pom.xml-tp17657445p21951942.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Ant Task - Build maven pom.xml

Posted by Hervé BOUTEMY <he...@free.fr>.
Hi,

I thought Tim's reply didn't need any addition, but it seems that even the 
documentation is still not clear enough (multiple people did a lot of work on 
it, though...).
Let's try to understand your problem, then improve the doc.

Perhaps 2 examples will help us to understand each other.

1. Maven Ant Tasks have a sample.build.xml [2] to unit-test the components 
features
As stated before, Maven Ant Tasks are not meant to really *build* a project, 
but only get dependencies. So you won't see in this example anything really 
building: only getting dependencies in multiple forms, installing an artifact 
into local repository and deploying to a remote repo (how the artifact 
installed/deployed is really build is not shown, since once again, it's not 
the purpose of the tasks)

2. Maven itself can be bootstrapped using Maven Ant Tasks: see build.xml in 
Maven Core sources [3]
This time, this is really a project (Maven Core) built by Ant, getting its 
multiple dependencies with Maven Ant Tasks: seems to be what you want to do 
with your project.
As you can see in the build file, most content is about building a specific 
project: there is only a little part that is about getting dependencies, ie 
the "pull" target (with its depends).


Are these examples more clear?


Regards,

Hervé


[2] 
http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/sample.build.xml?view=markup

[3] 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/build.xml?view=markup

Le mercredi 11 février 2009, vikask a écrit :
> Hi
>
> I am also facing same problem. Have anyone found solution?
>
> Thanks
>
> regards
> Vikas
>
> Tim Kettler wrote:
> > Hi,
> >
> > halsafar schrieb:
> >> I am trying to write an ant script to automate some maven tasks and
> >> hopefully
> >> decide not to rebuild the entire thing if it detects no changes.  Just
> >> to give an idea I am working with Jasig CAS Server which has several
> >> modules all which are Maven projects.  The build time is brutal on this
> >> beast and it
> >> will always rebuild no matter what it seems.  So even if Ant won't help
> >> I am
> >> still stuck using Ant as I need to auto-deploy the CAS Server to both a
> >> Tomcat and Glassfish server.  Now everything has been done and Maven is
> >> being run from a simple <exec> call in the build.xml for the ant script.
> >> I
> >> did find some Official Maven Ant Tasks jar I would like to try.  However
> >> I
> >> have been unable to find any examples which actually show this maven ant
> >> tasks   building a maven project.  Any help?
> >
> > The maven ant tasks bring the dependency management features of maven to
> > ant, they don't enable ant to build a maven project. Anyway, here [1] is
> > the link to the official homepage containing usage instructions.
> >
> > -Tim
> >
> > [1] http://maven.apache.org/ant-tasks.html
> >
> > ---------------------------------------------------------------------
> > 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: Ant Task - Build maven pom.xml

Posted by vikask <vi...@aikonlabs.com>.
Hi 

I am also facing same problem. Have anyone found solution?

Thanks

regards
Vikas


Tim Kettler wrote:
> 
> Hi,
> 
> halsafar schrieb:
>> I am trying to write an ant script to automate some maven tasks and
>> hopefully
>> decide not to rebuild the entire thing if it detects no changes.  Just to
>> give an idea I am working with Jasig CAS Server which has several modules
>> all which are Maven projects.  The build time is brutal on this beast and
>> it
>> will always rebuild no matter what it seems.  So even if Ant won't help I
>> am
>> still stuck using Ant as I need to auto-deploy the CAS Server to both a
>> Tomcat and Glassfish server.  Now everything has been done and Maven is
>> being run from a simple <exec> call in the build.xml for the ant script. 
>> I
>> did find some Official Maven Ant Tasks jar I would like to try.  However
>> I
>> have been unable to find any examples which actually show this maven ant
>> tasks   building a maven project.  Any help?
> 
> The maven ant tasks bring the dependency management features of maven to 
> ant, they don't enable ant to build a maven project. Anyway, here [1] is 
> the link to the official homepage containing usage instructions.
> 
> -Tim
> 
> [1] http://maven.apache.org/ant-tasks.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ant-Task---Build-maven-pom.xml-tp17657445p21948877.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Ant Task - Build maven pom.xml

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

halsafar schrieb:
> I am trying to write an ant script to automate some maven tasks and hopefully
> decide not to rebuild the entire thing if it detects no changes.  Just to
> give an idea I am working with Jasig CAS Server which has several modules
> all which are Maven projects.  The build time is brutal on this beast and it
> will always rebuild no matter what it seems.  So even if Ant won't help I am
> still stuck using Ant as I need to auto-deploy the CAS Server to both a
> Tomcat and Glassfish server.  Now everything has been done and Maven is
> being run from a simple <exec> call in the build.xml for the ant script.  I
> did find some Official Maven Ant Tasks jar I would like to try.  However I
> have been unable to find any examples which actually show this maven ant
> tasks   building a maven project.  Any help?

The maven ant tasks bring the dependency management features of maven to 
ant, they don't enable ant to build a maven project. Anyway, here [1] is 
the link to the official homepage containing usage instructions.

-Tim

[1] http://maven.apache.org/ant-tasks.html

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