You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kris Bravo <kr...@corridor-software.us> on 2005/06/23 18:28:48 UTC

2.0 dependency support in Ant 1.6.2?

Per the instructions at http://maven.apache.org/maven2/ant-tasks.html, I
am attempting to use the dependency management from Maven 2.0 in my
current ant build scripts (gave up on Maven 1.x and waiting for 2.0 to
settle - I was getting nothing done except troubleshooting new build
process errors)

I installed the jar, added the namespace to my build.xml project tag, then
put the following under a compile.lib target:

            <artifact:dependencies pathId="dependency.classpath">
              <dependency groupId="struts" artifactId="struts"
version="1.0.2"/>
              <localRepository
location="/data/users/bravo/.maven/repository" />
            </artifact:dependencies>

When the build gets to this step, I get a ClassCastException. So, does
anyone have this working? Ant 1.6.2,
maven-artifact-ant-2.0-alpha-2-dep.jar. Here's the stacktrace:

...Build/library.xml:18: java.lang.ClassCastException
        at org.apache.tools.ant.Task.perform(Task.java:373)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
        at org.apache.tools.ant.Main.runBuild(Main.java:658)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Caused by: java.lang.ClassCastException
        at
org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
       at
org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
        at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
        at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
        at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
        at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
        at
org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
        at
org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
        at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
        at
org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
        at
org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
        at
org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
        at
org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        ... 7 more
--- Nested Exception ---
java.lang.ClassCastException
        at
org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
       at
org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
        at
org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
        at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
        at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
        at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
        at
org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
        at
org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
        at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
        at
org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
        at
org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
        at
org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
        at
org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
        at org.apache.tools.ant.Main.runBuild(Main.java:658)
        at org.apache.tools.ant.Main.startAnt(Main.java:188)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)




-- 
Kris Bravo
Corridor Software, Inc.
http://corridor-software.us




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


Re: 2.0 dependency support in Ant 1.6.2?

Posted by Brett Porter <br...@gmail.com>.
I'm hoping to work on the docs today, though I should be able to cut
and paste it from this thread soon :)

Exclusions are for trimming out bad dependencies down the chain - not
what you want here. You really want scope="provided" on the
dependency, but now that you mention it I may not be honouring that in
Ant (and should be). Please let me know if this is the case.

Other alternatives:
- I think you can create a file set that contains a fileset and an
excludes pattern, which might help
- you can split it into 2 dependencies tasks, and only construct the
fileset from the second.

HTH,
Brett

On 6/24/05, Kris Bravo <kr...@corridor-software.us> wrote:
> Does it handle excludes? I have projects which depend on servlet or j2ee
> libraries but don't want to pack them in the application archive. I
> noticed this:
> 
> <exclusion groupId="junit" artifactId="junit"/>
> 
> in the example build.xml; however, it's inside a dependency tag. Is it
> intended to subtract entries from the filesetId or is it for some other
> purpose? It looks a little out of place where it's at:
> 
>     <dependency groupId="org.apache.maven.wagon"
> artifactId="wagon-provider-test" version="1.0-alpha-2">
>         <exclusion groupId="junit" artifactId="junit"/>
>       </dependency>
> 
> If you have a doc for the ant task details which I should be looking at
> let me know, but I do appreciate your help. I'm hoping to benefit from the
> repository f(x) in my existing build process until m2 is ready for prime
> time.
> 
> --
> Kris Bravo
> Corridor Software, Inc.
> http://corridor-software.us
> 
> > There is a filesetId attribute you can specify on the dependencies
> > task that you can later use to copy the dependencies without knowing
> > anything special about the repository like its layout.
> >
> > <dependencies filesetId="maven.deps">
> >  ...
> > </dependencies>
> >
> > <copy ... >
> >   <fileset refid="maven.deps" />
> > </copy>
> >
> > - Brett
> >
> 
> 
> 
> ---------------------------------------------------------------------
> 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: 2.0 dependency support in Ant 1.6.2?

Posted by Kris Bravo <kr...@corridor-software.us>.
Does it handle excludes? I have projects which depend on servlet or j2ee
libraries but don't want to pack them in the application archive. I
noticed this:

<exclusion groupId="junit" artifactId="junit"/>

in the example build.xml; however, it's inside a dependency tag. Is it
intended to subtract entries from the filesetId or is it for some other
purpose? It looks a little out of place where it's at:

    <dependency groupId="org.apache.maven.wagon"
artifactId="wagon-provider-test" version="1.0-alpha-2">
        <exclusion groupId="junit" artifactId="junit"/>
      </dependency>

If you have a doc for the ant task details which I should be looking at
let me know, but I do appreciate your help. I'm hoping to benefit from the
repository f(x) in my existing build process until m2 is ready for prime
time.

-- 
Kris Bravo
Corridor Software, Inc.
http://corridor-software.us

> There is a filesetId attribute you can specify on the dependencies
> task that you can later use to copy the dependencies without knowing
> anything special about the repository like its layout.
>
> <dependencies filesetId="maven.deps">
>  ...
> </dependencies>
>
> <copy ... >
>   <fileset refid="maven.deps" />
> </copy>
>
> - Brett
>



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


Re: 2.0 dependency support in Ant 1.6.2?

Posted by Brett Porter <br...@gmail.com>.
There is a filesetId attribute you can specify on the dependencies
task that you can later use to copy the dependencies without knowing
anything special about the repository like its layout.

<dependencies filesetId="maven.deps">
 ...
</dependencies>

<copy ... >
  <fileset refid="maven.deps" />
</copy>

- Brett

On 6/24/05, Kris Bravo <kr...@corridor-software.us> wrote:
> 
> That did the trick. The dependencies went into ~/.m2 and the build on it's
> merry way. Copying from the repository for war and ejb distributions
> doesn't seem much of a hassle.
> 
> Thanks for the update Brett,
> 
> --
> Kris Bravo
> Corridor Software, Inc.
> http://corridor-software.us
> 
> > Hi Kris,
> >
> > I have just published a new version now (alpha-3) which is improved. I
> > think this will be fixed. Updated docs will be forthcoming tomorrow -
> > check out sample.build.xml in SVN in the mean time. Your existing
> > scripts will work, but it also takes a POM and has a verbose mode,
> > among other things.
> >
> > http://repo1.maven.org/maven2/org/apache/maven/maven-artifact-ant/2.0-alpha-3/maven-artifact-ant-2.0-alpha-3-dep.jar
> >
> > - Brett
> >
> > On 6/24/05, Kris Bravo <kr...@corridor-software.us> wrote:
> >>
> >> Per the instructions at http://maven.apache.org/maven2/ant-tasks.html, I
> >> am attempting to use the dependency management from Maven 2.0 in my
> >> current ant build scripts (gave up on Maven 1.x and waiting for 2.0 to
> >> settle - I was getting nothing done except troubleshooting new build
> >> process errors)
> >>
> >> I installed the jar, added the namespace to my build.xml project tag,
> >> then
> >> put the following under a compile.lib target:
> >>
> >>             <artifact:dependencies pathId="dependency.classpath">
> >>               <dependency groupId="struts" artifactId="struts"
> >> version="1.0.2"/>
> >>               <localRepository
> >> location="/data/users/bravo/.maven/repository" />
> >>             </artifact:dependencies>
> >>
> >> When the build gets to this step, I get a ClassCastException. So, does
> >> anyone have this working? Ant 1.6.2,
> >> maven-artifact-ant-2.0-alpha-2-dep.jar. Here's the stacktrace:
> >>
> >> ...Build/library.xml:18: java.lang.ClassCastException
> >>         at org.apache.tools.ant.Task.perform(Task.java:373)
> >>         at org.apache.tools.ant.Target.execute(Target.java:341)
> >>         at
> >> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
> >>         at
> >> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
> >>         at org.apache.tools.ant.Main.runBuild(Main.java:658)
> >>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
> >>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
> >>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> >> Caused by: java.lang.ClassCastException
> >>         at
> >> org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
> >>        at
> >> org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
> >>         at
> >> org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
> >>         at
> >> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
> >>         at
> >> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
> >>         at
> >> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
> >>         at
> >> org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
> >>         at
> >> org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
> >>         at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
> >>         at
> >> org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
> >>         at
> >> org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
> >>         at
> >> org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
> >>         at
> >> org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
> >>         at
> >> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> >>         at org.apache.tools.ant.Task.perform(Task.java:364)
> >>         ... 7 more
> >> --- Nested Exception ---
> >> java.lang.ClassCastException
> >>         at
> >> org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
> >>        at
> >> org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
> >>         at
> >> org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
> >>         at
> >> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
> >>         at
> >> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
> >>         at
> >> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
> >>         at
> >> org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
> >>         at
> >> org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
> >>         at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
> >>         at
> >> org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
> >>         at
> >> org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
> >>         at
> >> org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
> >>         at
> >> org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
> >>         at
> >> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> >>         at org.apache.tools.ant.Task.perform(Task.java:364)
> >>         at org.apache.tools.ant.Target.execute(Target.java:341)
> >>         at
> >> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
> >>         at
> >> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
> >>         at org.apache.tools.ant.Main.runBuild(Main.java:658)
> >>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
> >>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
> >>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> >>
> >>
> >>
> >>
> >> --
> >> Kris Bravo
> >> Corridor Software, Inc.
> >> http://corridor-software.us
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> 
>

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


Re: 2.0 dependency support in Ant 1.6.2?

Posted by Kris Bravo <kr...@corridor-software.us>.
That did the trick. The dependencies went into ~/.m2 and the build on it's
merry way. Copying from the repository for war and ejb distributions
doesn't seem much of a hassle.

Thanks for the update Brett,

-- 
Kris Bravo
Corridor Software, Inc.
http://corridor-software.us

> Hi Kris,
>
> I have just published a new version now (alpha-3) which is improved. I
> think this will be fixed. Updated docs will be forthcoming tomorrow -
> check out sample.build.xml in SVN in the mean time. Your existing
> scripts will work, but it also takes a POM and has a verbose mode,
> among other things.
>
> http://repo1.maven.org/maven2/org/apache/maven/maven-artifact-ant/2.0-alpha-3/maven-artifact-ant-2.0-alpha-3-dep.jar
>
> - Brett
>
> On 6/24/05, Kris Bravo <kr...@corridor-software.us> wrote:
>>
>> Per the instructions at http://maven.apache.org/maven2/ant-tasks.html, I
>> am attempting to use the dependency management from Maven 2.0 in my
>> current ant build scripts (gave up on Maven 1.x and waiting for 2.0 to
>> settle - I was getting nothing done except troubleshooting new build
>> process errors)
>>
>> I installed the jar, added the namespace to my build.xml project tag,
>> then
>> put the following under a compile.lib target:
>>
>>             <artifact:dependencies pathId="dependency.classpath">
>>               <dependency groupId="struts" artifactId="struts"
>> version="1.0.2"/>
>>               <localRepository
>> location="/data/users/bravo/.maven/repository" />
>>             </artifact:dependencies>
>>
>> When the build gets to this step, I get a ClassCastException. So, does
>> anyone have this working? Ant 1.6.2,
>> maven-artifact-ant-2.0-alpha-2-dep.jar. Here's the stacktrace:
>>
>> ...Build/library.xml:18: java.lang.ClassCastException
>>         at org.apache.tools.ant.Task.perform(Task.java:373)
>>         at org.apache.tools.ant.Target.execute(Target.java:341)
>>         at
>> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
>>         at
>> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
>>         at org.apache.tools.ant.Main.runBuild(Main.java:658)
>>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
>>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
>> Caused by: java.lang.ClassCastException
>>         at
>> org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
>>        at
>> org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
>>         at
>> org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
>>         at
>> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
>>         at
>> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
>>         at
>> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
>>         at
>> org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
>>         at
>> org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
>>         at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
>>         at
>> org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
>>         at
>> org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
>>         at
>> org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
>>         at
>> org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
>>         at
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>         at org.apache.tools.ant.Task.perform(Task.java:364)
>>         ... 7 more
>> --- Nested Exception ---
>> java.lang.ClassCastException
>>         at
>> org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
>>        at
>> org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
>>         at
>> org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
>>         at
>> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
>>         at
>> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
>>         at
>> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
>>         at
>> org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
>>         at
>> org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
>>         at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
>>         at
>> org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
>>         at
>> org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
>>         at
>> org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
>>         at
>> org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
>>         at
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>         at org.apache.tools.ant.Task.perform(Task.java:364)
>>         at org.apache.tools.ant.Target.execute(Target.java:341)
>>         at
>> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
>>         at
>> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
>>         at org.apache.tools.ant.Main.runBuild(Main.java:658)
>>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
>>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
>>
>>
>>
>>
>> --
>> Kris Bravo
>> Corridor Software, Inc.
>> http://corridor-software.us
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: 2.0 dependency support in Ant 1.6.2?

Posted by Brett Porter <br...@gmail.com>.
Hi Kris,

I have just published a new version now (alpha-3) which is improved. I
think this will be fixed. Updated docs will be forthcoming tomorrow -
check out sample.build.xml in SVN in the mean time. Your existing
scripts will work, but it also takes a POM and has a verbose mode,
among other things.

http://repo1.maven.org/maven2/org/apache/maven/maven-artifact-ant/2.0-alpha-3/maven-artifact-ant-2.0-alpha-3-dep.jar

- Brett

On 6/24/05, Kris Bravo <kr...@corridor-software.us> wrote:
> 
> Per the instructions at http://maven.apache.org/maven2/ant-tasks.html, I
> am attempting to use the dependency management from Maven 2.0 in my
> current ant build scripts (gave up on Maven 1.x and waiting for 2.0 to
> settle - I was getting nothing done except troubleshooting new build
> process errors)
> 
> I installed the jar, added the namespace to my build.xml project tag, then
> put the following under a compile.lib target:
> 
>             <artifact:dependencies pathId="dependency.classpath">
>               <dependency groupId="struts" artifactId="struts"
> version="1.0.2"/>
>               <localRepository
> location="/data/users/bravo/.maven/repository" />
>             </artifact:dependencies>
> 
> When the build gets to this step, I get a ClassCastException. So, does
> anyone have this working? Ant 1.6.2,
> maven-artifact-ant-2.0-alpha-2-dep.jar. Here's the stacktrace:
> 
> ...Build/library.xml:18: java.lang.ClassCastException
>         at org.apache.tools.ant.Task.perform(Task.java:373)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
>         at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
>         at org.apache.tools.ant.Main.runBuild(Main.java:658)
>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> Caused by: java.lang.ClassCastException
>         at
> org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
>        at
> org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
>         at
> org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
>         at
> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
>         at
> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
>         at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
>         at
> org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
>         at
> org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
>         at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
>         at
> org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
>         at
> org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
>         at
> org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
>         at
> org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
>         at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         ... 7 more
> --- Nested Exception ---
> java.lang.ClassCastException
>         at
> org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
>        at
> org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
>         at
> org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
>         at
> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
>         at
> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
>         at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:208)
>         at
> org.codehaus.plexus.DefaultPlexusContainer.initializeLoggerManager(DefaultPlexusContainer.java:1057)
>         at
> org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:533)
>         at org.codehaus.plexus.embed.Embedder.start(Embedder.java:204)
>         at
> org.apache.maven.artifact.ant.AbstractArtifactTask.getEmbedder(AbstractArtifactTask.java:103)
>         at
> org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:84)
>         at
> org.apache.maven.artifact.ant.AbstractArtifactTask.createArtifactRepository(AbstractArtifactTask.java:43)
>         at
> org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:63)
>         at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>         at org.apache.tools.ant.Task.perform(Task.java:364)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:133)
>         at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
>         at org.apache.tools.ant.Main.runBuild(Main.java:658)
>         at org.apache.tools.ant.Main.startAnt(Main.java:188)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> 
> 
> 
> 
> --
> Kris Bravo
> Corridor Software, Inc.
> http://corridor-software.us
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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