in src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java [93:114]
private void addResources(Resource resource) throws MojoExecutionException {
getLog().info(
String.format("Adding resources [%s] to [%s]", resource
.getDirectory(), resource.getTargetPath()));
String[] fileNames = getFilesToCopy(resource);
for (int i = 0; i < fileNames.length; i++) {
String targetFileName = fileNames[i];
if (resource.getTargetPath() != null) {
targetFileName = resource.getTargetPath() + File.separator
+ targetFileName;
}
try {
jarArchiver.addFile(new File(resource.getDirectory(),
fileNames[i]), targetFileName);
} catch (ArchiverException e) {
throw new MojoExecutionException(
"Unable to add resources to JAR file", e);
}
}
}