Does Maven Mojo have Equivalent to ant's DirSet?

107 views Asked by At

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

1

There are 1 answers

0
Peter Kahn On

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