Uploaded image for project: 'Maven Ant Tasks (RETIRED)'
  1. Maven Ant Tasks (RETIRED)
  2. MANTTASKS-37

The Dependencies task of Maven Antlib should override an existing path reference instead of failing

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.6
    • 2.0.7
    • dependencies task
    • None
    • Solaris 10, Ant 1.7.0, Maven Antlib 2.0.4

    Description

      In the Maven Antlib 2.0.4 with Ant 1.7.0 when using the <dependencies> task with the pathId attribute:

      <dependencies pathId="compile.path">
      ...
      <dependencies>

      The following error is raised if a "compile.path" reference already exists:

      [maven:dependencies] An error has occurred while processing the Maven artifact tasks.
      [maven:dependencies] Diagnosis:
      [maven:dependencies]
      [maven:dependencies] Reference ID compile.path already exists

      In fact the error is raised even if the "compile.path" reference is defiend in another target whcih is not executed at runtime. This is due to Ant 1.7.0 which resolves references at parsing time so when the <dependencies> task get executed the "compile.path" reference already exists and the Maven <dependencies> task fails.

      Other Ant tasks like the <path> task do not fail when a reference is already defined. They simply override the reference.

      The maven :dependencies task should mimic the Ant <path> behaviour and accept to override a reference which is already defined.

      This could be implemented by removing the following code from the DependenciesTask.doExecute() method:

      if ( pathId != null && getProject().getReference( pathId ) != null )

      { throw new BuildException( "Reference ID " + pathId + " already exists" ); }

      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              loicjay Loïc Jay
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: