protected Collection<File> getXARXMLFiles() throws MojoFailureException
    {
        // Find all files in the resources dir
        File resourcesDir = getResourcesDirectory();

        Collection<File> files = new ArrayList<>();
        if (resourcesDir.exists()) {
            PlexusIoFileResourceCollection collection = new PlexusIoFileResourceCollection();
            collection.setBaseDir(resourcesDir);

            FileSelector[] selectors;

            IncludeExcludeFileSelector fs = new IncludeExcludeFileSelector();
            fs.setIncludes(getIncludes());
            fs.setExcludes(getExcludes());

            IncludeExcludeFileSelector fs2 = new IncludeExcludeFileSelector();
            fs2.setExcludes(new String[] {PACKAGE_XML});
            selectors = new FileSelector[] {fs, fs2};

            collection.setFileSelectors(selectors);

            Iterator<PlexusIoResource> resources;
            try {
                resources = collection.getResources();
            } catch (IOException e) {
                throw new MojoFailureException("Failed to get list of XAR XML files", e);
            }
            while (resources.hasNext()) {
                PlexusIoResource resource = resources.next();
                if (resource.isFile()) {
                    files.add(new File(collection.getBaseDir(), resource.getName()));
                }
            }
        }

        return files;
    }
protected Collection < File > getXARXMLFiles ( ) throws MojoFailureException { File resourcesDir = getResourcesDirectory ( ) ; Collection < File > files = new ArrayList < > ( ) ; if ( resourcesDir . exists ( ) ) { PlexusIoFileResourceCollection collection = new PlexusIoFileResourceCollection ( ) ; collection . setBaseDir ( resourcesDir ) ; FileSelector [ ] selectors ; IncludeExcludeFileSelector fs = new IncludeExcludeFileSelector ( ) ; fs . setIncludes ( getIncludes ( ) ) ; fs . setExcludes ( getExcludes ( ) ) ; IncludeExcludeFileSelector fs2 = new IncludeExcludeFileSelector ( ) ; fs2 . setExcludes ( new String [ ] { PACKAGE_XML } ) ; selectors = new FileSelector [ ] { fs , fs2 } ; collection . setFileSelectors ( selectors ) ; Iterator < PlexusIoResource > resources ; try { resources = collection . getResources ( ) ; } catch ( IOException e ) { throw new MojoFailureException ( "Failed to get list of XAR XML files" , e ) ; } while ( resources . hasNext ( ) ) { PlexusIoResource resource = resources . next ( ) ; if ( resource . isFile ( ) ) { files . add ( new File ( collection . getBaseDir ( ) , resource . getName ( ) ) ) ; } } } return files ; }
@return the list of XAR XML files in this project
@exception MojoFailureException when an error happens reading the XAR XML files on the file system