@Override
public JarPackagingProcessor importBuildOutput(MavenResolutionStrategy strategy) throws ResolutionException,
IllegalArgumentException, UnsupportedOperationException {
final ParsedPomFile pomFile = session.getParsedPomFile();
// add source filed if any
if (Validate.isReadable(pomFile.getSourceDirectory())) {
compile(pomFile.getSourceDirectory(), pomFile.getBuildOutputDirectory(), ScopeType.COMPILE, ScopeType.IMPORT,
ScopeType.PROVIDED, ScopeType.RUNTIME, ScopeType.SYSTEM);
JavaArchive classes = ShrinkWrap.create(ExplodedImporter.class, "sources.jar")
.importDirectory(pomFile.getBuildOutputDirectory()).as(JavaArchive.class);
archive = archive.merge(classes);
}
JarPluginConfiguration jarConfiguration = new JarPluginConfiguration(pomFile);
// add resources
for (Resource resource : pomFile.getResources()) {
archive.addAsResource(resource.getSource(), resource.getTargetPath());
}
// set manifest
Manifest manifest = jarConfiguration.getArchiveConfiguration().asManifest();