List<MavenResource> (List<Resource> resources) { if (resources == null) return new ArrayList<MavenResource>(); List<MavenResource> result = new ArrayList<MavenResource>(resources.size()); for (Resource each : resources) { String directory = each.getDirectory(); if (null == directory) continue; result.add(new MavenResource(directory, each.isFiltering(), each.getTargetPath(), ensurePatterns(each.getIncludes()), ensurePatterns(each.getExcludes()))); } return result; }