You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by benxs <bx...@yahoo.co.uk> on 2010/07/14 19:02:37 UTC

Relationsship "pom.xml" and "build.xml" from Ant

Sorry for this Maven newbie question but I want to clarify the relationsship
between pom.xml and Ant's build.xml.
Are the following statements correct?

pom.xml is solely Maven related
build.xml is solely Ant related

Both do not (never) depend on each other (are e.g. included).

So if I get a project which contains a pom.xml and a build.xml then the
developer offers to use
either Ant or Maven. If I select Maven then I can delete build.xml. If I
select Ant then I can delete pom.xml without harm.

Is there a way to convert a build.xml into a pom.xml and vice versa?
Ok in case of pom.xml -> build.xml I would loose some functionality but this
should not be the question at this point.

Is there such a converter?

Thank you
Ben
-- 
View this message in context: http://maven.40175.n5.nabble.com/Relationsship-pom-xml-and-build-xml-from-Ant-tp1092912p1092912.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: Relationsship "pom.xml" and "build.xml" from Ant

Posted by Wayne Fay <wa...@gmail.com>.
> pom.xml is solely Maven related
> build.xml is solely Ant related

It is possible to build Maven projects from Ant, and vice versa.

> either Ant or Maven. If I select Maven then I can delete build.xml. If I
> select Ant then I can delete pom.xml without harm.

Generally yes, but not always.

> Is there a way to convert a build.xml into a pom.xml and vice versa?

No.

Wayne

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


RE: Relationsship "pom.xml" and "build.xml" from Ant

Posted by "Gorham-Engard, Frank" <Fr...@cable.comcast.com>.
Also, if an ant build uses the Ant Maven plugin, for example to access a dependency, the plugin will read the pom file.

<!-- Frank Gorham-Engard →
"Be kinder than necessary. 
  Everyone you work here with is fighting some kind of battle."


-----Original Message-----
From: Shan Syed [mailto:shan.ss@gmail.com] 
Sent: Wednesday, July 14, 2010 1:08 PM
To: Maven Users List
Subject: Re: Relationsship "pom.xml" and "build.xml" from Ant

maven/POMs can make use of ant build scripts, so be wary of this
scenario; it is fairly common to use ant via maven

> So if I get a project which contains a pom.xml and a build.xml then the
> developer offers to use
> either Ant or Maven. If I select Maven then I can delete build.xml. If I
> select Ant then I can delete pom.xml without harm.

also a project can have various components that build in different
ways, so again, I wouldn't make the above assumption

there is no way to convert an ant build script into a maven POM,
because ant scripts don't have any kind of enforced convention; it
would be impossible to write such a converter



On Wed, Jul 14, 2010 at 1:02 PM, benxs <bx...@yahoo.co.uk> wrote:
>
> Sorry for this Maven newbie question but I want to clarify the relationsship
> between pom.xml and Ant's build.xml.
> Are the following statements correct?
>
> pom.xml is solely Maven related
> build.xml is solely Ant related
>
> Both do not (never) depend on each other (are e.g. included).
>
> So if I get a project which contains a pom.xml and a build.xml then the
> developer offers to use
> either Ant or Maven. If I select Maven then I can delete build.xml. If I
> select Ant then I can delete pom.xml without harm.
>
> Is there a way to convert a build.xml into a pom.xml and vice versa?
> Ok in case of pom.xml -> build.xml I would loose some functionality but this
> should not be the question at this point.
>
> Is there such a converter?
>
> Thank you
> Ben
> --
> View this message in context: http://maven.40175.n5.nabble.com/Relationsship-pom-xml-and-build-xml-from-Ant-tp1092912p1092912.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
>
>

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


Re: Relationsship "pom.xml" and "build.xml" from Ant

Posted by Shan Syed <sh...@gmail.com>.
you can reference an external build file within the ant-run plugin, so
something like:

..
<ant antfile="${basedir}/build.xml">
                  <target name="test"/>
                </ant>
..

taken from the second example
http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html

chances are that in your case:
-the two separate builds are required to build the overall project,
and maybe they didn't have time to migrate certain parts of the ant
build to maven
or
-the maven build references the ant one and invokes it
and/or
-the ant is used for something other than an actual build (ant is
still a great tool for other stuff)

On Wed, Jul 14, 2010 at 1:37 PM, benxs <bx...@yahoo.co.uk> wrote:
>
>>maven/POMs can make use of ant build scripts, so be wary of this
>>scenario; it is fairly common to use ant via maven
>
> Thank you. But how do I find out if a pom.xml uses a build.xml in the same
> directory?
>
> Do I have to search for a
> <include>build.xml</include>
> or a
> <call>build.xml</call>
>
> statement in pom.xml?
>
> Ben
> --
> View this message in context: http://maven.40175.n5.nabble.com/Relationsship-pom-xml-and-build-xml-from-Ant-tp1092912p1092935.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
>
>

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


Re: Relationsship "pom.xml" and "build.xml" from Ant

Posted by Wayne Fay <wa...@gmail.com>.
> Thank you. But how do I find out if a pom.xml uses a build.xml in the same
> directory?

Ask the person who built the code/gave you the project, or check for
project documentation.

Wayne

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


Re: Relationsship "pom.xml" and "build.xml" from Ant

Posted by benxs <bx...@yahoo.co.uk>.
>maven/POMs can make use of ant build scripts, so be wary of this 
>scenario; it is fairly common to use ant via maven 

Thank you. But how do I find out if a pom.xml uses a build.xml in the same
directory?

Do I have to search for a
<include>build.xml</include>
or a
<call>build.xml</call>

statement in pom.xml?

Ben
-- 
View this message in context: http://maven.40175.n5.nabble.com/Relationsship-pom-xml-and-build-xml-from-Ant-tp1092912p1092935.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: Relationsship "pom.xml" and "build.xml" from Ant

Posted by Shan Syed <sh...@gmail.com>.
maven/POMs can make use of ant build scripts, so be wary of this
scenario; it is fairly common to use ant via maven

> So if I get a project which contains a pom.xml and a build.xml then the
> developer offers to use
> either Ant or Maven. If I select Maven then I can delete build.xml. If I
> select Ant then I can delete pom.xml without harm.

also a project can have various components that build in different
ways, so again, I wouldn't make the above assumption

there is no way to convert an ant build script into a maven POM,
because ant scripts don't have any kind of enforced convention; it
would be impossible to write such a converter



On Wed, Jul 14, 2010 at 1:02 PM, benxs <bx...@yahoo.co.uk> wrote:
>
> Sorry for this Maven newbie question but I want to clarify the relationsship
> between pom.xml and Ant's build.xml.
> Are the following statements correct?
>
> pom.xml is solely Maven related
> build.xml is solely Ant related
>
> Both do not (never) depend on each other (are e.g. included).
>
> So if I get a project which contains a pom.xml and a build.xml then the
> developer offers to use
> either Ant or Maven. If I select Maven then I can delete build.xml. If I
> select Ant then I can delete pom.xml without harm.
>
> Is there a way to convert a build.xml into a pom.xml and vice versa?
> Ok in case of pom.xml -> build.xml I would loose some functionality but this
> should not be the question at this point.
>
> Is there such a converter?
>
> Thank you
> Ben
> --
> View this message in context: http://maven.40175.n5.nabble.com/Relationsship-pom-xml-and-build-xml-from-Ant-tp1092912p1092912.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
>
>

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