Implement isolated Build and Refresh with immutable leased snapshots
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package de.neitzel.fxdesigner.maven;
|
||||
|
||||
import java.nio.file.*;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugins.annotations.*;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
@Mojo(name = "dependencies", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true)
|
||||
public final class DependenciesMojo extends AbstractMojo {
|
||||
@Parameter(defaultValue = "${project}", readonly = true, required = true)
|
||||
private MavenProject project;
|
||||
|
||||
@Parameter(property = "designer.captureDir", required = true)
|
||||
private java.io.File directory;
|
||||
|
||||
public void execute() throws MojoExecutionException {
|
||||
try {
|
||||
Files.createDirectories(directory.toPath());
|
||||
try (var out =
|
||||
Files.newOutputStream(
|
||||
directory.toPath().resolve(DependencyProof.id(project) + ".dependencies"))) {
|
||||
DependencyProof.capture(project).store(out, "Dependency identities before compilation");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new MojoExecutionException("Cannot capture build dependency identities", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user