Re: Maven Ant Task problem when used with Ant 1.7.0

2007-01-11 Thread Matt Benson
--- Kevin Jackson [EMAIL PROTECTED] 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:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 



 

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Maven Ant Task problem when used with Ant 1.7.0

2007-01-10 Thread Loic Jay

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

Re: Maven Ant Task problem when used with Ant 1.7.0

2007-01-10 Thread Matt Benson
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 [EMAIL PROTECTED] 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
 notisreference
 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 


Re: Maven Ant Task problem when used with Ant 1.7.0

2007-01-10 Thread Matt Benson
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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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
  notisreference
  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
 
 

Re: Maven Ant Task problem when used with Ant 1.7.0

2007-01-10 Thread Peter Reilly

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
   echoHere/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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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
  notisreference
  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
 


Re: Maven Ant Task problem when used with Ant 1.7.0

2007-01-10 Thread Matt Benson
--- Peter Reilly [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven Ant Task problem when used with Ant 1.7.0

2007-01-10 Thread Kevin Jackson

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven Ant Task problem when used with Ant 1.7.0

2007-01-09 Thread Kevin Jackson

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]