You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by raju <ra...@hotmail.com> on 2007/01/05 07:11:59 UTC

Invoking ant java Task from Maven or similar approaches in MAVEN

Hi ,
Currently I am invoking java org.apache.xalan.xslt.Process using an ant
build file in order to generate output based on XSL.IS there any way i can
do the same in MAVEN or maybe call this ant script from within MAVEN POM.

<?xml version="1.0" encoding="UTF-8"?>
<project name="Code Generation" default="build" basedir=".">
	<property file="build.properties"/>
	<target name="build">
		<java classname="harsh.javatoxml.Java2XML" fork="true" >
			<arg line="${dir.src}/*.java"/>
			<classpath>
				<pathelement location="${java2xml.jarpath}"/>
			</classpath>
		</java>
		<java classname="org.apache.xalan.xslt.Process" fork="true" >
			<arg line="-in ${dir.outputsrcxml}/output.xml -xsl
${dir.inputsrcxml}/initial.xsl"/>
			<classpath>
				<!-- Using Saxon as didnt find option to write output to java-->
				<pathelement location="${saxonapi.jar}"/>
				<pathelement location="${xalanapi.jar}"/>
				<!--<pathelement location="${env.XALAN_BIN}/bsf.jar"/>-->
			</classpath>
		</java>
	</target>
</project>

Regards
Raju
-- 
View this message in context: http://www.nabble.com/Invoking-ant-java-Task-from-Maven-or-similar-approaches-in-MAVEN-tf2924117s177.html#a8173529
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: Invoking ant java Task from Maven or similar approaches in MAVEN

Posted by "dawn.angelito" <da...@simulalabs.com>.
Hi Raju,

Try to set your M2_REPO to C:\Documents and
Settings\<yourmachine>\.m2\repository.

Dawn


dawn.angelito wrote:
> 
> Hi Raju,
> 
> You can do this by adding this snippet of code to your pom.xml:
> 
>             <configuration>
>               <tasks>
>                 <ant antfile="${basedir}/build.xml" inheritRefs="true">
>                   <target name="test"/>
>                 </ant>
>               </tasks>
>             </configuration>
> 
> You may also refer to
> http://maven.apache.org/plugins/maven-antrun-plugin/classpaths.html.
> 
> Hope this helps.
> 
> Dawn
> 
> 
> 
> raju wrote:
>> 
>> Hi ,
>> Currently I am invoking java org.apache.xalan.xslt.Process using an ant
>> build file in order to generate output based on XSL.IS there any way i
>> can do the same in MAVEN or maybe call this ant script from within MAVEN
>> POM.
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project name="Code Generation" default="build" basedir=".">
>> 	<property file="build.properties"/>
>> 	<target name="build">
>> 		<java classname="harsh.javatoxml.Java2XML" fork="true" >
>> 			<arg line="${dir.src}/*.java"/>
>> 			<classpath>
>> 				<pathelement location="${java2xml.jarpath}"/>
>> 			</classpath>
>> 		</java>
>> 		<java classname="org.apache.xalan.xslt.Process" fork="true" >
>> 			<arg line="-in ${dir.outputsrcxml}/output.xml -xsl
>> ${dir.inputsrcxml}/initial.xsl"/>
>> 			<classpath>
>> 				
>> 				<pathelement location="${saxonapi.jar}"/>
>> 				<pathelement location="${xalanapi.jar}"/>
>> 				
>> 			</classpath>
>> 		</java>
>> 	</target>
>> </project>
>> 
>> Regards
>> Raju
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Invoking-ant-java-Task-from-Maven-or-similar-approaches-in-MAVEN-tf2924117s177.html#a8211071
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: Invoking ant java Task from Maven or similar approaches in MAVEN

Posted by "dawn.angelito" <da...@simulalabs.com>.
Hi Raju,

You can do this by adding this snippet of code to your pom.xml:

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

You may also refer to
http://maven.apache.org/plugins/maven-antrun-plugin/classpaths.html.

Hope this helps.

Dawn



raju wrote:
> 
> Hi ,
> Currently I am invoking java org.apache.xalan.xslt.Process using an ant
> build file in order to generate output based on XSL.IS there any way i can
> do the same in MAVEN or maybe call this ant script from within MAVEN POM.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="Code Generation" default="build" basedir=".">
> 	<property file="build.properties"/>
> 	<target name="build">
> 		<java classname="harsh.javatoxml.Java2XML" fork="true" >
> 			<arg line="${dir.src}/*.java"/>
> 			<classpath>
> 				<pathelement location="${java2xml.jarpath}"/>
> 			</classpath>
> 		</java>
> 		<java classname="org.apache.xalan.xslt.Process" fork="true" >
> 			<arg line="-in ${dir.outputsrcxml}/output.xml -xsl
> ${dir.inputsrcxml}/initial.xsl"/>
> 			<classpath>
> 				
> 				<pathelement location="${saxonapi.jar}"/>
> 				<pathelement location="${xalanapi.jar}"/>
> 				
> 			</classpath>
> 		</java>
> 	</target>
> </project>
> 
> Regards
> Raju
> 

-- 
View this message in context: http://www.nabble.com/Invoking-ant-java-Task-from-Maven-or-similar-approaches-in-MAVEN-tf2924117s177.html#a8175641
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: Invoking ant java Task from Maven or similar approaches in MAVEN

Posted by Marco Mistroni <mm...@gmail.com>.
Hi,
 you can use maven ant plugin and use same code that is within your <target>
elements
not sure if it can be an alternative, but if you are doing xslt there's an
xslt task in ant.....

hth
 marco

On 1/5/07, raju <ra...@hotmail.com> wrote:
>
>
> Hi ,
> Currently I am invoking java org.apache.xalan.xslt.Process using an ant
> build file in order to generate output based on XSL.IS there any way i can
> do the same in MAVEN or maybe call this ant script from within MAVEN POM.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="Code Generation" default="build" basedir=".">
>         <property file="build.properties"/>
>         <target name="build">
>                 <java classname="harsh.javatoxml.Java2XML" fork="true" >
>                         <arg line="${dir.src}/*.java"/>
>                         <classpath>
>                                 <pathelement location="${java2xml.jarpath
> }"/>
>                         </classpath>
>                 </java>
>                 <java classname="org.apache.xalan.xslt.Process"
> fork="true" >
>                         <arg line="-in ${dir.outputsrcxml}/output.xml -xsl
> ${dir.inputsrcxml}/initial.xsl"/>
>                         <classpath>
>                                 <!-- Using Saxon as didnt find option to
> write output to java-->
>                                 <pathelement location="${saxonapi.jar}"/>
>                                 <pathelement location="${xalanapi.jar}"/>
>                                 <!--<pathelement location="${env.XALAN_BIN
> }/bsf.jar"/>-->
>                         </classpath>
>                 </java>
>         </target>
> </project>
>
> Regards
> Raju
> --
> View this message in context:
> http://www.nabble.com/Invoking-ant-java-Task-from-Maven-or-similar-approaches-in-MAVEN-tf2924117s177.html#a8173529
> 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
>
>