Maven 2.x Ant Tasks

artifact:dependencies filesetId attribute causes NPE

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.6
  • Fix Version/s: 2.0.7
  • Component/s: dependencies task
  • Labels:
    None
  • Environment:
    Ant 1.6.5, Maven tasks for Ant 2.0.4, Solaris 10, Jdk 1.4.2_10
  • Number of attachments :
    1

Description

Using the maven ant tasks I receive a null pointer if I set a fileset ref and then set a property with that ref.
However if a set a path ref I do not get a NPE.

I think is caused by the fileset not having its project set.
If this is the case the following line needs to be added to the DependenciesTask:
194d194
< fileSet.setProject( getProject() );

Exception:
java.lang.NullPointerException
at org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:382)

<!-- Script that fails -->
<artifact:dependencies verbose="true"
filesetId="maven.dependency.fileset"
useScope="compile">
<pom refid="maven.project.pom" />
<localRepository refid="maven.local.repository" />
</artifact:dependencies>
<property name="my.fileset.property" refid="maven.dependency.fileset"/>

<!-- Script that works -->
<artifact:dependencies verbose="true"
pathId="maven.dependency.path"
useScope="compile">
<pom refid="maven.project.pom" />
<localRepository refid="maven.local.repository" />
</artifact:dependencies>
<property name="my.path.property" refid="maven.dependency.path"/>

Activity

Hide
Jeff Maxwell added a comment -

I tested the setProject fix and worked.
I will submit a patch ASAP.

Show
Jeff Maxwell added a comment - I tested the setProject fix and worked. I will submit a patch ASAP.
Hide
Jeff Maxwell added a comment -

Patch for DependenciesTask

Show
Jeff Maxwell added a comment - Patch for DependenciesTask
Hide
Jason van Zyl added a comment -

Patch applied.

Show
Jason van Zyl added a comment - Patch applied.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: