use of org.codehaus.plexus.archiver.util.DefaultArchivedFileSet in project maven-plugins by apache.
the class AssemblyProxyArchiver method addArchivedFileSet.
/**
* {@inheritDoc}
*/
@Override
public void addArchivedFileSet(@Nonnull final File archiveFile, final String prefix) {
inPublicApi.set(Boolean.TRUE);
try {
final DefaultArchivedFileSet fs = new DefaultArchivedFileSet(archiveFile);
fs.setPrefix(rootPrefix + prefix);
fs.setFileSelectors(selectors);
debug("Adding archived file-set in: " + archiveFile + " to archive location: " + fs.getPrefix());
delegate.addArchivedFileSet(fs);
} finally {
inPublicApi.set(null);
}
}
use of org.codehaus.plexus.archiver.util.DefaultArchivedFileSet in project maven-plugins by apache.
the class AddArtifactTask method unpacked.
private void unpacked(Archiver archiver, String destDirectory) throws ArchiveCreationException {
String outputLocation = destDirectory;
if ((outputLocation.length() > 0) && !outputLocation.endsWith("/")) {
outputLocation += "/";
}
String[] includesArray = TypeConversionUtils.toStringArray(includes);
if (includesArray == null) {
includesArray = DEFAULT_INCLUDES_ARRAY;
}
final String[] excludesArray = TypeConversionUtils.toStringArray(excludes);
try {
final File artifactFile = artifact.getFile();
if (artifactFile == null) {
logger.warn("Skipping artifact: " + artifact.getId() + "; it does not have an associated file or directory.");
} else if (artifactFile.isDirectory()) {
logger.debug("Adding artifact directory contents for: " + artifact + " to: " + outputLocation);
DefaultFileSet fs = DefaultFileSet.fileSet(artifactFile);
fs.setIncludes(includesArray);
fs.setExcludes(excludesArray);
fs.setPrefix(outputLocation);
fs.setStreamTransformer(transformer);
archiver.addFileSet(fs);
} else {
logger.debug("Unpacking artifact contents for: " + artifact + " to: " + outputLocation);
logger.debug("includes:\n" + StringUtils.join(includesArray, "\n") + "\n");
logger.debug("excludes:\n" + (excludesArray == null ? "none" : StringUtils.join(excludesArray, "\n")) + "\n");
DefaultArchivedFileSet afs = DefaultArchivedFileSet.archivedFileSet(artifactFile);
afs.setIncludes(includesArray);
afs.setExcludes(excludesArray);
afs.setPrefix(outputLocation);
afs.setStreamTransformer(transformer);
archiver.addArchivedFileSet(afs, encoding);
}
} catch (final ArchiverException e) {
throw new ArchiveCreationException("Error adding file-set for '" + artifact.getId() + "' to archive: " + e.getMessage(), e);
}
}
use of org.codehaus.plexus.archiver.util.DefaultArchivedFileSet in project maven-plugins by apache.
the class AssemblyProxyArchiver method addArchivedFileSet.
/**
* {@inheritDoc}
*/
@Override
public void addArchivedFileSet(final File archiveFile, final String[] includes, final String[] excludes) {
inPublicApi.set(Boolean.TRUE);
try {
final DefaultArchivedFileSet fs = new DefaultArchivedFileSet(archiveFile);
fs.setIncludes(includes);
fs.setExcludes(excludes);
fs.setPrefix(rootPrefix);
fs.setFileSelectors(selectors);
debug("Adding archived file-set in: " + archiveFile + " to archive location: " + fs.getPrefix());
delegate.addArchivedFileSet(fs);
} finally {
inPublicApi.set(null);
}
}
use of org.codehaus.plexus.archiver.util.DefaultArchivedFileSet in project maven-plugins by apache.
the class AssemblyProxyArchiver method addArchivedFileSet.
/**
* {@inheritDoc}
*/
@Override
public void addArchivedFileSet(@Nonnull final File archiveFile, final String prefix, final String[] includes, final String[] excludes) {
inPublicApi.set(Boolean.TRUE);
try {
final DefaultArchivedFileSet fs = new DefaultArchivedFileSet(archiveFile);
fs.setIncludes(includes);
fs.setExcludes(excludes);
fs.setPrefix(rootPrefix + prefix);
fs.setFileSelectors(selectors);
debug("Adding archived file-set in: " + archiveFile + " to archive location: " + fs.getPrefix());
delegate.addArchivedFileSet(fs);
} finally {
inPublicApi.set(null);
}
}
use of org.codehaus.plexus.archiver.util.DefaultArchivedFileSet in project maven-plugins by apache.
the class AssemblyProxyArchiver method addArchivedFileSet.
/**
* {@inheritDoc}
*/
@Override
public void addArchivedFileSet(@Nonnull final File archiveFile) {
inPublicApi.set(Boolean.TRUE);
try {
final DefaultArchivedFileSet fs = new DefaultArchivedFileSet(archiveFile);
fs.setPrefix(rootPrefix);
fs.setFileSelectors(selectors);
debug("Adding archived file-set in: " + archiveFile + " to archive location: " + fs.getPrefix());
delegate.addArchivedFileSet(fs);
} finally {
inPublicApi.set(null);
}
}
Aggregations