-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
cli/src/main/java/eu/maveniverse/maven/toolbox/cli/ListRepositories.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2023-2024 Maveniverse Org. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
package eu.maveniverse.maven.toolbox.cli; | ||
|
||
import eu.maveniverse.maven.mima.context.Context; | ||
import eu.maveniverse.maven.toolbox.shared.ResolutionScope; | ||
import eu.maveniverse.maven.toolbox.shared.ToolboxCommando; | ||
import picocli.CommandLine; | ||
|
||
/** | ||
* Resolves transitively a given GAV and outputs classpath path. | ||
*/ | ||
@CommandLine.Command(name = "listRepositories", description = "Lists repositories used to resolve given GAV") | ||
public final class ListRepositories extends ResolverCommandSupport { | ||
@CommandLine.Parameters(index = "0", description = "The GAV to list repositories for") | ||
private String gav; | ||
|
||
@CommandLine.Option( | ||
names = {"--resolutionScope"}, | ||
defaultValue = "runtime", | ||
description = "Resolution scope to resolve (default main-runtime)") | ||
private String resolutionScope; | ||
|
||
@CommandLine.Option( | ||
names = {"--boms"}, | ||
defaultValue = "", | ||
split = ",", | ||
description = "Comma separated list of BOMs to apply") | ||
private java.util.List<String> boms; | ||
|
||
@Override | ||
protected boolean doCall(Context context) throws Exception { | ||
ToolboxCommando toolboxCommando = ToolboxCommando.getOrCreate(context); | ||
return toolboxCommando.listRepositories( | ||
ResolutionScope.parse(resolutionScope), | ||
toolboxCommando.toolboxResolver().loadGav(gav, boms), | ||
output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters