You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Siefert, David" <ds...@playboy.com> on 2009/10/28 20:17:37 UTC

dependencies ant task > using localRepository type with refid causes ClassCastException

Hi,

Doing the following in an ant project causes a java.lang.ClassCastException: org.apache.maven.artifact.ant.LocalRepository--

       <taskdef classpathref="ant.classpath" classname="org.apache.maven.artifact.ant.DependenciesTask" name="dependencies" />
       <typedef classpathref="ant.classpath" classname="org.apache.maven.artifact.ant.LocalRepository" name="localRepository" />

       <localRepository id="local.lib.repository" layout="default" path="${local-repository.path}" />

       <dependencies pathId="compile.classpath" verbose="true">
              <!-- dependencies listed here -->
              <localRepository refid="local.lib.repository" />
       </dependencies>

However, the following works fine--

       <taskdef classpathref="ant.classpath" classname="org.apache.maven.artifact.ant.DependenciesTask" name="dependencies" />
       <typedef classpathref="ant.classpath" classname="org.apache.maven.artifact.ant.LocalRepository" name="localRepository" />

       <dependencies pathId="compile.classpath" verbose="true">
              <!-- dependencies listed here -->
              <localRepository layout="default" path="${local-repository.path}" />
       </dependencies>

Same thing happens for the RemoteRepository type.  Any ideas why this might be happening?

Thanks,
David