Maven Ant Tasks
  1. Maven Ant Tasks
  2. MANTTASKS-2

artifact:dependencies related error: No files specified for filelist

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.8
    • Component/s: dependencies task
    • Labels:
      None
    • Number of attachments :
      0

      Activity

      Hide
      Chad Berghorst added a comment -

      If a project does not have any dependencies, the resulting path will cause a "No files specified for filelist" error when trying to reference it. Here is a related user list thread: http://www.mail-archive.com/users@maven.apache.org/msg25990.html. Although Brett requested a bug submission, I did not yet see one in JIRA.

      Show
      Chad Berghorst added a comment - If a project does not have any dependencies, the resulting path will cause a "No files specified for filelist" error when trying to reference it. Here is a related user list thread: http://www.mail-archive.com/users@maven.apache.org/msg25990.html . Although Brett requested a bug submission, I did not yet see one in JIRA.
      Hide
      Chad Berghorst added a comment -

      Here is an example of when the error occurs (assuming no compile dependencies exist in the related POM):

      <artifact:dependencies
      pomrefid="maven.project"
      pathId="dependency.compile.classpath"
      verbose="true"
      useScope="compile"
      />
      <property name="cp" refid="dependency.compile.classpath"/>

      Show
      Chad Berghorst added a comment - Here is an example of when the error occurs (assuming no compile dependencies exist in the related POM): <artifact:dependencies pomrefid="maven.project" pathId="dependency.compile.classpath" verbose="true" useScope="compile" /> <property name="cp" refid="dependency.compile.classpath"/>
      Hide
      Brett Porter added a comment -

      what do you propose should happen? empty fileset?

      Show
      Brett Porter added a comment - what do you propose should happen? empty fileset?
      Hide
      Chad Berghorst added a comment -

      After talking with another Maven Ant task user (Dave Brondsema), we've determined that Ant's FileList getFiles() method throws an exception instead of an empty String array when no files are specified. For testing purposes, I made the following changes to DependenciesTask.java to avoid this exception. I didn't create a patch because this code isn't the cleanest.

      FileList fileList = new FileList();
      boolean fileListElementsAdded = false;
      ...

      for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )

      { fileList.addConfiguredFile( file ); fileListElementsAdded = true; }

      ...

      if ( pathId != null )
      {
      Path path = new Path( getProject() );
      if (fileListElementsAdded)

      { path.addFilelist( fileList ); }

      getProject().addReference( pathId, path );
      }

      Show
      Chad Berghorst added a comment - After talking with another Maven Ant task user (Dave Brondsema), we've determined that Ant's FileList getFiles() method throws an exception instead of an empty String array when no files are specified. For testing purposes, I made the following changes to DependenciesTask.java to avoid this exception. I didn't create a patch because this code isn't the cleanest. FileList fileList = new FileList(); boolean fileListElementsAdded = false; ... for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); ) { fileList.addConfiguredFile( file ); fileListElementsAdded = true; } ... if ( pathId != null ) { Path path = new Path( getProject() ); if (fileListElementsAdded) { path.addFilelist( fileList ); } getProject().addReference( pathId, path ); }

        People

        • Assignee:
          Herve Boutemy
          Reporter:
          Chad Berghorst
        • Votes:
          2 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: