Home > Maven > Maven – files included by FileSet

Maven – files included by FileSet

Btw, in case you was wondering (like I did one day) how one gets (in a Maven plugin) all files included by a FileSet, here’s the answer:

import org.apache.maven.shared.model.fileset.FileSet;
import org.apache.maven.shared.model.fileset.util.FileSetManager;
import java.util.Arrays;

...

FileSet fs = new FileSet();
fs.setDirectory( ".." );
fs.setIncludes( Arrays.asList( "..", ".." ));
fs.setExcludes( Arrays.asList( "..", ".." ));
String[] files = new FileSetManager().getIncludedFiles( fs );

Dependency – org.apache.maven.shared:file-management (javadoc, repo1, examples):

<dependency>
    <groupId>org.apache.maven.shared</groupId>
    <artifactId>file-management</artifactId>
    <version>1.2.1</version>
    <scope>compile</scope>
</dependency>
Advertisements
Categories: Maven Tags: ,
  1. February 18, 2013 at 23:33

    “Maven – files included by FileSet Goldin, the Junior” was indeed a quite nice posting,
    . I hope you keep composing and I’ll continue to keep reading through! Many thanks -Violet

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: