Uploaded image for project: 'Maven Antrun Plugin'
  1. Maven Antrun Plugin
  2. MANTRUN-59

Taskdef/Typedef and Plugin dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 1.1
    • None
    • None

    Description

      I'm trying to run an ant task during a Maven run. The classes for that Ant task are included in my Maven runtime dependencies(maven.runtime.classpath).
      Here the relevant snippet from my POM:
      <tasks>
      <path id="my.maven.runtime.classpath">
      <path refid="maven.runtime.classpath"/>
      </path>

      <taskdef name="mostGenerator" classname="com.bmw.most.generator.AntTask" classpathref="maven.runtime.classpath"/>

      <mostGenerator configurationFile="mostGenerator.configuration" targetDirectory="target/generated-sources/most"/>
      </tasks>

      This works if I don't provide depedencies in the POM for my plugin. But if I do provide depedencies it doesn't work. I consider this to be a bug since that should have no effect on the behaviour of "maven.runtime.classpath". My first guess is that this is a classloading issue. Probably by providing dependencies the classloaders get messed up and that causes the taskdef to not load the classes from maven.runtime.classpath because echoing the value of maven.runtime.classpath still gives the right classpath.

      I have tried all variants of dereferencing maven.runtime.classpath. Didn't work.
      Also which is very interesting if I hardcode the classpath in the taskdef to absolute pathnames it also does not work.

      Attachments

        Issue Links

          Activity

            People

              bmargulies Benson Margulies
              ttest ttest
              Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: