1

I'm uplifting an ant plugin to maven plugin and my ant plugin used a DirSet and I see that maven only has a FileSet.

  • Can I use FileSet to just gather directories?
  • Should I create my own dirset class either from reviewing Ant's PatternSet - DirSet code and then implementing a similar solution using maven's PatternSet and or FileSet?
  • Is there a better way to gather directories with includes and excludes?

Thanks for the help

Peter

Peter Kahn
  • 12,364
  • 20
  • 77
  • 135

1 Answers1

0

Found it on Maven's File Management examples page.

FileSetManager fileSetManager = new FileSetManager();
String[] includedFiles = fileSetManager.getIncludedFiles( fileset );
String[] includedDir = fileSetManager.getIncludedDirectories( fileset );
String[] excludedFiles = fileSetManager.getExcludedFiles( fileset );
String[] excludedDir = fileSetManager.getExcludedDirectories( fileset );
fileSetManager.delete( fileset );
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135