in atomos.maven/src/main/java/org/apache/felix/atomos/maven/index/AtomosIndexMojo.java [71:131]
public void execute() throws MojoExecutionException
{
if (index == null)
{
index = new MavenIndexConfig();
}
if (classpath == null)
{
MavenClassPathConfig classPathConfig = new MavenClassPathConfig();
MavenClasspathMavenConfig mavenIndexMojoConfig = new MavenClasspathMavenConfig();
classPathConfig.maven = List.of(mavenIndexMojoConfig);
classpath = classPathConfig;
}
if (index.indexOutputType == null)
{
index.indexOutputType = IndexOutputType.DIRECTORY;//TODO: ??? IndexOutputType.DIRECTORY;
}
try
{
File outputDirectory = project.getBasedir();
Files.createDirectories(outputDirectory.toPath());
LauncherBuilder builder = Launcher.builder();
//Collect files using paths and filters
Optional.ofNullable(classpath.paths)//
.orElse(List.of())//
.forEach(cc -> {
PathCollectorPluginConfig pc = LauncherBuilderUtil.processClasspathFile(
cc);
builder.addPlugin(PathCollectorPlugin.class, pc);
});
//Collect files from maven project
Optional.ofNullable(classpath.maven)//
.orElse(List.of())//
.forEach(cc -> {
PathCollectorPluginConfig pc = LauncherBuilderUtil.processClasspathMaven(
project, cc);
builder.addPlugin(PathCollectorPlugin.class, pc);
});
//Index-Plugin
IndexPluginConfig ic = LauncherBuilderUtil.processIndex(index, project);
builder.addPlugin(IndexPlugin.class, ic);
//Shade
//TODO: use own shader
// ShadeConfig sc = LauncherBuilderUtil.processShade(builder, shade, project);
// builder.addPlugin(ShaderPlugin.class, sc);
builder.build().execute();
}
catch (Exception e)
{
throw new MojoExecutionException("Error", e);
}
}