Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Mar 21, 2024
1 parent a6adc76 commit 5a12b4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ public class GavTreeMojo extends AbstractMojo {
private String gav;

/**
* The resolution scope to display, accepted values are "main-runtime", "main-compile", "test-runtime" or
* "test-compile".
* The resolution scope to display, accepted values are "runtime", "compile", "test", etc.
*/
@Parameter(property = "scope", defaultValue = "main-runtime", required = true)
@Parameter(property = "scope", defaultValue = "runtime", required = true)
private String scope;

/**
Expand All @@ -59,7 +58,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
try (Context context = runtime.create(ContextOverrides.create().build())) {
ToolboxCommando toolboxCommando = ToolboxCommando.getOrCreate(runtime, context);
toolboxCommando.tree(
ResolutionScope.parse(scope), toolboxCommando.loadGav(gav, boms), false, new Slf4jOutput(logger));
ResolutionScope.parse(scope), toolboxCommando.loadGav(gav, boms), verbose, new Slf4jOutput(logger));
} catch (RuntimeException e) {
throw new MojoExecutionException(e);
} catch (ArtifactDescriptorException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import eu.maveniverse.maven.mima.context.ContextOverrides;
import eu.maveniverse.maven.mima.context.Runtime;
import eu.maveniverse.maven.mima.context.Runtimes;
import eu.maveniverse.maven.toolbox.shared.ResolutionRoot;
import eu.maveniverse.maven.toolbox.shared.ResolutionScope;
import eu.maveniverse.maven.toolbox.shared.Slf4jOutput;
import eu.maveniverse.maven.toolbox.shared.ToolboxCommando;
Expand All @@ -31,10 +30,9 @@ public class TreeMojo extends AbstractMojo {
private final Logger logger = LoggerFactory.getLogger(getClass());

/**
* The resolution scope to display, accepted values are "main-runtime", "main-compile", "test-runtime" or
* "test-compile".
* The resolution scope to display, accepted values are "runtime", "compile", "test", etc.
*/
@Parameter(property = "scope", defaultValue = "main-runtime", required = true)
@Parameter(property = "scope", defaultValue = "runtime", required = true)
private String scope;

/**
Expand All @@ -53,12 +51,15 @@ public class TreeMojo extends AbstractMojo {
public void execute() throws MojoExecutionException, MojoFailureException {
Runtime runtime = Runtimes.INSTANCE.getRuntime();
try (Context context = runtime.create(ContextOverrides.create().build())) {
ResolutionRoot root = MavenProjectHelper.toRoot(
mavenProject,
artifactHandlerManager,
context.repositorySystemSession().getArtifactTypeRegistry());
ToolboxCommando.getOrCreate(runtime, context)
.tree(ResolutionScope.parse(scope), root, false, new Slf4jOutput(logger));
.tree(
ResolutionScope.parse(scope),
MavenProjectHelper.toRoot(
mavenProject,
artifactHandlerManager,
context.repositorySystemSession().getArtifactTypeRegistry()),
verbose,
new Slf4jOutput(logger));
} catch (RuntimeException e) {
throw new MojoExecutionException(e.getCause());
}
Expand Down

0 comments on commit 5a12b4e

Please sign in to comment.