use of org.apache.maven.plugin.assembly.model.FileSet in project fabric8-maven-plugin by fabric8io.
the class JavaExecGenerator method createFileSet.
private FileSet createFileSet(String sourceDir, String outputDir, String fileMode, String directoryMode) {
FileSet fileSet = new FileSet();
fileSet.setDirectory(sourceDir);
fileSet.setOutputDirectory(outputDir);
fileSet.setFileMode(fileMode);
fileSet.setDirectoryMode(directoryMode);
return fileSet;
}
use of org.apache.maven.plugin.assembly.model.FileSet in project fabric8-maven-plugin by fabric8io.
the class JavaExecGenerator method addAssembly.
protected void addAssembly(AssemblyConfiguration.Builder builder) throws MojoExecutionException {
String assemblyRef = getConfig(Config.assemblyRef);
if (assemblyRef != null) {
builder.descriptorRef(assemblyRef);
} else {
if (isFatJar()) {
FatJarDetector.Result fatJar = detectFatJar();
Assembly assembly = new Assembly();
MavenProject project = getProject();
if (fatJar == null) {
DependencySet dependencySet = new DependencySet();
dependencySet.addInclude(project.getGroupId() + ":" + project.getArtifactId());
assembly.addDependencySet(dependencySet);
} else {
FileSet fileSet = new FileSet();
File buildDir = new File(project.getBuild().getDirectory());
fileSet.setDirectory(toRelativePath(buildDir, project.getBasedir()));
fileSet.addInclude(toRelativePath(fatJar.getArchiveFile(), buildDir));
fileSet.setOutputDirectory(".");
assembly.addFileSet(fileSet);
}
assembly.addFileSet(createFileSet("src/main/fabric8-includes/bin", "bin", "0755", "0755"));
assembly.addFileSet(createFileSet("src/main/fabric8-includes", ".", "0644", "0755"));
builder.assemblyDef(assembly);
} else {
builder.descriptorRef("artifact-with-dependencies");
}
}
;
}
Aggregations