You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mohan1982 <mo...@gmail.com> on 2009/10/23 09:39:06 UTC

How do I convert build.xml into maven.xml?

Hi All,

I have a build.xml and maven.xml.  I am using the following goal into
maven.xml to call ant:target in build.xml
 <goal name="ejb.test">
         <ant:echo> mohan </ant:echo>
		 <ant antfile="build.xml" inheritrefs="true" target="ejb.build">
		 <property file="mohan.properties"/>
	 </ant>
 </goal> 
My Issue is: when I run ejb.test goal, It's failing to recognize the
classpaths/properties which are defined in build.xml file.

It looks like except the ant:target (ejb.build) nothing ( other environment)
is visible to the maven goal.

my build.xml is very big in size, so I dont want to copy/paste all the
targets into maven.xml .

So, What is the best way to let maven goal to know all the environment
defined in build.xml file?

I heard that we can write a plugin to achieve that. If that is true can any
body provide documentation links ( plz provide direct links) to do that ?

Advanced thanks
-- 
View this message in context: http://www.nabble.com/How-do-I-convert-build.xml-into-maven.xml--tp26022041p26022041.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: How do I convert build.xml into maven.xml?

Posted by mohan1982 <mo...@gmail.com>.
Thankyou for your quick reply. Yes I am using maven 1.x only.

But I was able to make some progress but unfortunately found one more issue.
below is my maven goal

<goal name="maven-goal">
         <ant:echo> mohan in maven goal</ant:echo>
		 <ant antfile="build.xml" inheritrefs="true" target="ant-target">
		 </ant>

	</goal> 

and below is my build.xml:
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE project [
 <!ENTITY sunny SYSTEM "sunny-sample.xml">
]>

<project name="tests" default="main" basedir=".">
<import file="level-2-build.xml"/>
<property file="test.properties"/>
<property file="test1.properties"/>
<property file="mohan.properties"/>
<!-- <property name="property" value="build.xml.property"/> -->

@sunny


 
  <target name="ant-target">
 
    <echo> "MOHAN" in ant target </echo>
	<echo> ${src} in mohan.properties</echo>
	<echo> ${sample} in test.propertes</echo>
	<echo> ${jars} </echo>
	<echo> ${property-level2} </echo>
  </target>

  

	
</project>

But when I execute the maven-goal I am getting the below error: 

Unexpected element "import"

But very thing working fine , when I remove the following segment from my
build.xml:

<!DOCTYPE project [
 <!ENTITY sunny SYSTEM "sunny-sample.xml">
]>

what I need to do achieve the same functionality ?





Wayne Fay wrote:
> 
>> I have a build.xml and maven.xml.  I am using the following goal into
>> maven.xml to call ant:target in build.xml
> 
> It sounds like you're talking about Maven1 which means you're
> essentially on your own. M1 is old, crusty, and not very many people
> on this list are still using it which means you'll have trouble
> getting good answers to your questions.
> 
> You should take this opportunity to update your build to the latest
> Maven2 release (with pom.xml files etc) rather than wasting time
> making an M1 build. And btw, Maven3 is expected to land in the
> (relatively) near future, too.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> 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/How-do-I-convert-build.xml-into-maven.xml--tp26022041p26030087.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: How do I convert build.xml into maven.xml?

Posted by Wayne Fay <wa...@gmail.com>.
> I have a build.xml and maven.xml.  I am using the following goal into
> maven.xml to call ant:target in build.xml

It sounds like you're talking about Maven1 which means you're
essentially on your own. M1 is old, crusty, and not very many people
on this list are still using it which means you'll have trouble
getting good answers to your questions.

You should take this opportunity to update your build to the latest
Maven2 release (with pom.xml files etc) rather than wasting time
making an M1 build. And btw, Maven3 is expected to land in the
(relatively) near future, too.

Wayne

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