ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Loic Jay <Loic....@Sun.COM>
Subject Maven Ant Task problem when used with Ant 1.7.0
Date Wed, 10 Jan 2007 08:45:20 GMT
Hi,

I have submitted the following problem to the Maven mailing list which 
redirected me to this Ant mailing list.

The problem occurs when I use the maven ant task 2.0.4 with Ant 1.7.0.
The fileset created by the <maven:dependencies> task raises a 
NullPointerException when used in the Ant <pathconvert> task.

The following code :

        <!-- The Artifact to be looked for with the maven dependencies 
task -->
        <property name="artifact.groupid" value="junit"/>
        <property name="artifact.id" value="junit"/>               
        <property name="artifact.version" value="3.8.1"/>

       <!-- Try retrieving the artifact as a fileset -->
        <maven:dependencies filesetId="dependency.files">
            <dependency groupId="${artifact.groupid}"
                artifactId="${artifact.id}"
                version="${artifact.version}"/>                   
</maven:dependencies>      
        <!-- The following does not fail, showing that a fileset 
reference has
             actually been defined -->
        <fail message="Reference 'dependency.files' has not been set or 
is not a fileset reference.">
            <condition>
                <not><isreference refid="dependency.files" 
type="fileset"/></not>
            </condition>
        </fail>
        <!-- But the following task throws a NullPointerException -->
        <pathconvert property="echo.dependency.files" 
refid="dependency.files"/>

Raises the following NullPointerException:

java.lang.NullPointerException
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
        at 
org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:464)
        at 
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:430)
        at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
        at 
org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
        at org.apache.tools.ant.types.resources.Union.list(Union.java:67)
        at 
org.apache.tools.ant.taskdefs.PathConvert.execute(PathConvert.java:339)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        ... 11 more
--- Nested Exception ---
java.lang.NullPointerException
        at 
org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:464)
        at 
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:430)
        at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
        at 
org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
        at org.apache.tools.ant.types.resources.Union.list(Union.java:67)
        at 
org.apache.tools.ant.taskdefs.PathConvert.execute(PathConvert.java:339)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Any idea if this is an incompatibility introduced with Ant 1.7.0 ?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message