You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by abc abc <ne...@yahoo.com> on 2005/11/18 00:40:14 UTC

Problem in Maven

I have an ANT build script, and i slowly want to migrate to Maven.
  So, initially i want my ant Script to be invoked from Maven.
  I have a jar file which contains a class that I am using in build.xml file.
  The build.xml file and that jar file reside in same directory, and the ant script is working fine.
  I am doing something like this in my build.xml file.
  <taskdef name="replaceProperty"
 classname="com.abc.def.ant.utils.ReplaceProperty"/>
 <tstamp><format property="build.date" pattern="yyyy-MM-dd@hhmmss"/></tstamp>
 
 <replaceProperty propertyName="build.date" newPropertyValue="${build.date}" propertyFilePath="build.properties" />
  The package com.abc.def.ant.utils.ReplaceProperty lies inside the jar which is in the same directory as of build.xml, and works fine with ant script.
  But now, when i run maven from some other directory and call this ant script from there, it gives the following error:-
  Build failed
taskdef class com.abc.def.ant.utils.ReplaceProperty cannot be found.
  Please help ....
  waiting for your response.
  
 

		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Problem in Maven

Posted by Brett Porter <br...@gmail.com>.
You need to add a classpathref to the taskdef so it can find the jar.

If you wish to do this in the "maven way" - put the jar in your local
repository, add it as a dependency in your project with
<properties><classloader>root</classloader></properties>

Cheers,
Brett

On 11/18/05, abc abc <ne...@yahoo.com> wrote:
> I have an ANT build script, and i slowly want to migrate to Maven.
>   So, initially i want my ant Script to be invoked from Maven.
>   I have a jar file which contains a class that I am using in build.xml file.
>   The build.xml file and that jar file reside in same directory, and the ant script is working fine.
>   I am doing something like this in my build.xml file.
>   <taskdef name="replaceProperty"
>  classname="com.abc.def.ant.utils.ReplaceProperty"/>
>  <tstamp><format property="build.date" pattern="yyyy-MM-dd@hhmmss"/></tstamp>
>
>  <replaceProperty propertyName="build.date" newPropertyValue="${build.date}" propertyFilePath="build.properties" />
>   The package com.abc.def.ant.utils.ReplaceProperty lies inside the jar which is in the same directory as of build.xml, and works fine with ant script.
>   But now, when i run maven from some other directory and call this ant script from there, it gives the following error:-
>   Build failed
> taskdef class com.abc.def.ant.utils.ReplaceProperty cannot be found.
>   Please help ....
>   waiting for your response.
>
>
>
>
> ---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in one click.
>

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