You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Loic Jay <Lo...@Sun.COM> on 2007/01/09 16:41:36 UTC

Maven Ant Task problem when used with Ant 1.7.0

Hi,

I have a problem when using 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.

Here an excerpt of the code which runs into this problem:


        <!-- 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"/>


Are the maven ant task supposed to work with the last Ant 1.7.0 version ?
Any idea about what causes this problem ?

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Loic Jay <Lo...@Sun.COM>.
Thanks Kevin,

I have forwarded the previous mail completed with the full stack trace 
to the ant dev list.

Loïc

Kevin Jackson wrote On 01/10/07 08:44 AM,:

> Hi,
>
>>         <!-- But the following task throws a NullPointerException -->
>>         <pathconvert property="echo.dependency.files"
>> refid="dependency.files"/>
>>
>>
>> Are the maven ant task supposed to work with the last Ant 1.7.0 
>> version ?
>> Any idea about what causes this problem ?
>
>
> Ant 1.7 introduced the concept of ResourceCollections, this code would
> have affected filesets, but I cannot diagnose the problem further
> without a full stack trace from you NullPointerException.
>
> Would you post this to the ant dev list : dev@ant.apache.org
>
> Thanks
> Kev



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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Loic Jay <Lo...@Sun.COM>.

> Ant 1.7 introduced the concept of ResourceCollections, this code would
> have affected filesets, but I cannot diagnose the problem further
> without a full stack trace from you NullPointerException.
>
> Would you post this to the ant dev list : dev@ant.apache.org

Hi,

Just a little update for those who may encounter this problem.

The ant dev team has investigated the problem and it appears the NPE was 
raised because the Ant project was not set  on  the fileset created by  
the  "maven:dependencies" task.

The Ant code has been fixed to avoid raising an NPE is such a case.

Thanks to Kevin and Matt for the help.

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Matt Benson <gu...@yahoo.com>.
--- Kevin Jackson <fo...@gmail.com> wrote:

> Hi Matt,
> 
> > I have checked in code to fix this.  Those
> > experiencing the problem might want to test
> against a
> > build from SVN HEAD to verify the problem is fixed
> for
> > them.  It wouldn't hurt to remind the Maven folks
> to
> > set the Project instance on artifacts they create,
> > either.
> >
> 
> That was quick! And congrats on committership for
> commons btw

RE Quick:  because it was my change that triggered the
error in the first place, even though all I really did
was uncover their error.  :)

RE Congrats:  Thanks!

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



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Kevin Jackson <fo...@gmail.com>.
Hi Matt,

> I have checked in code to fix this.  Those
> experiencing the problem might want to test against a
> build from SVN HEAD to verify the problem is fixed for
> them.  It wouldn't hurt to remind the Maven folks to
> set the Project instance on artifacts they create,
> either.
>

That was quick! And congrats on committership for commons btw

Kev

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Matt Benson <gu...@yahoo.com>.
--- Matt Benson <gu...@yahoo.com> wrote:

> --- Peter Reilly <pe...@gmail.com>
> wrote:
> 
> > It looks like it is some strange stuff with
> > path through the code  that just avoids an NPE in
> > ant.1.6.5.
> [SNIP]
> > I am not sure how to fix this in ant.
> > 
> 
> I've got it.  It is indeed a case of the Maven code
> not having set Project references on their
> artifacts. 
> PITA, but not the end of the world.  The simplified
> pathconvert code triggers the problem.  My simple
> testcase is:
> 
> <project>
>   <fileset id="fs" dir="${basedir}" />
> 
>   <script language="beanshell">
>     fs.setProject(null);
>   </script>
> 
>   <pathconvert refid="fs" />
> </project>
> 
> which triggers the NPE in AbstractFileSet.  I am
> testing a fix now.
> 

I have checked in code to fix this.  Those
experiencing the problem might want to test against a
build from SVN HEAD to verify the problem is fixed for
them.  It wouldn't hurt to remind the Maven folks to
set the Project instance on artifacts they create,
either.

-Matt

> -Matt
> 
> > Peter
> [SNIP]
> 
> 
>  
>
____________________________________________________________________________________
> Any questions? Get answers on any topic at
> www.Answers.yahoo.com.  Try it now.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Matt Benson <gu...@yahoo.com>.
--- Peter Reilly <pe...@gmail.com> wrote:

> It looks like it is some strange stuff with
> path through the code  that just avoids an NPE in
> ant.1.6.5.
[SNIP]
> I am not sure how to fix this in ant.
> 

I've got it.  It is indeed a case of the Maven code
not having set Project references on their artifacts. 
PITA, but not the end of the world.  The simplified
pathconvert code triggers the problem.  My simple
testcase is:

<project>
  <fileset id="fs" dir="${basedir}" />

  <script language="beanshell">
    fs.setProject(null);
  </script>

  <pathconvert refid="fs" />
</project>

which triggers the NPE in AbstractFileSet.  I am
testing a fix now.

-Matt

> Peter
[SNIP]


 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Peter Reilly <pe...@gmail.com>.
It looks like it is some strange stuff with
path through the code  that just avoids an NPE in ant.1.6.5.

On ant 1.6.5 with the following file and the maven jar in lib,
the first echo works but the second echo fails:

<project name="test-maven" default="test"
         xmlns:maven="antlib:org.apache.maven.artifact.ant">
  <target name="test">
    <typedef
      uri="antlib:org.apache.maven.artifact.ant"
      resource="org/apache/maven/artifact/ant/antlib.xml"
      >
      <classpath>
        <fileset dir="lib" includes="*.jar"/>
      </classpath>
    </typedef>
    <echo>Here</echo>
    <property name="artifact.groupid" value="junit"/>
    <property name="artifact.id" value="junit"/>
    <property name="artifact.version" value="3.8.1"/>
    <setproxy proxyhost="${proxy}" proxyport="8000"/>
    <maven:dependencies filesetId="dependency.files">
      <dependency groupId="${artifact.groupid}"
                  artifactId="${artifact.id}"
                  version="${artifact.version}"/>
    </maven:dependencies>
    <pathconvert property="echo.dependency.files"
                 refid="dependency.files"/>

    <echo>${echo.dependency.files}</echo>   <!--  1 -->
    <echo>${toString:dependency.files}</echo>  <!-- 2 -->
  </target>
</project>

I am not sure how to fix this in ant.

Peter


On 1/10/07, Matt Benson <gu...@yahoo.com> wrote:
> Sorry... to go farther down the stacktrace, I should
> correct myself:  it appears that the Maven guys don't
> set a project on their fileset when they create it, or
> something.  So it's a bug for them, but possibly a
> regression for Ant after all, if you want to look at
> it that way.
>
> -Matt
>
> --- Matt Benson <gu...@yahoo.com> wrote:
>
> > That looks like a bug in the Maven task.  The only
> > way
> > for an NPE to be triggered here would seem to
> > indicate
> > the task passed null as the project argument to
> > getDirectoryScanner().  Looking at Ant 1.6.5's code
> > it
> > appears that the same exception would be thrown,
> > however, so I am confused how this problem only
> > showed
> > up with Ant 1.7.0.
> >
> > -Matt
> >
> > --- Loic Jay <Lo...@Sun.COM> wrote:
> >
> > > 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
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > dev-help@ant.apache.org
> >
> >
>
>
>
>
> ____________________________________________________________________________________
> Need a quick answer? Get one in minutes from people who know.
> Ask your question on www.Answers.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Matt Benson <gu...@yahoo.com>.
Sorry... to go farther down the stacktrace, I should
correct myself:  it appears that the Maven guys don't
set a project on their fileset when they create it, or
something.  So it's a bug for them, but possibly a
regression for Ant after all, if you want to look at
it that way.

-Matt

--- Matt Benson <gu...@yahoo.com> wrote:

> That looks like a bug in the Maven task.  The only
> way
> for an NPE to be triggered here would seem to
> indicate
> the task passed null as the project argument to
> getDirectoryScanner().  Looking at Ant 1.6.5's code
> it
> appears that the same exception would be thrown,
> however, so I am confused how this problem only
> showed
> up with Ant 1.7.0.
> 
> -Matt
> 
> --- Loic Jay <Lo...@Sun.COM> wrote:
> 
> > 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
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 



 
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Matt Benson <gu...@yahoo.com>.
That looks like a bug in the Maven task.  The only way
for an NPE to be triggered here would seem to indicate
the task passed null as the project argument to
getDirectoryScanner().  Looking at Ant 1.6.5's code it
appears that the same exception would be thrown,
however, so I am confused how this problem only showed
up with Ant 1.7.0.

-Matt

--- Loic Jay <Lo...@Sun.COM> wrote:

> 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
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Maven Ant Task problem when used with Ant 1.7.0

Posted by Loic Jay <Lo...@Sun.COM>.
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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Kevin Jackson <fo...@gmail.com>.
Hi,

>         <!-- But the following task throws a NullPointerException -->
>         <pathconvert property="echo.dependency.files"
> refid="dependency.files"/>
>
>
> Are the maven ant task supposed to work with the last Ant 1.7.0 version ?
> Any idea about what causes this problem ?

Ant 1.7 introduced the concept of ResourceCollections, this code would
have affected filesets, but I cannot diagnose the problem further
without a full stack trace from you NullPointerException.

Would you post this to the ant dev list : dev@ant.apache.org

Thanks
Kev

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


Re: Maven Ant Task problem when used with Ant 1.7.0

Posted by Kevin Jackson <fo...@gmail.com>.
Hi,

>         <!-- But the following task throws a NullPointerException -->
>         <pathconvert property="echo.dependency.files"
> refid="dependency.files"/>
>
>
> Are the maven ant task supposed to work with the last Ant 1.7.0 version ?
> Any idea about what causes this problem ?

Ant 1.7 introduced the concept of ResourceCollections, this code would
have affected filesets, but I cannot diagnose the problem further
without a full stack trace from you NullPointerException.

Would you post this to the ant dev list : dev@ant.apache.org

Thanks
Kev

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