Package org.openrewrite.maven
Class MavenExecutionContextView
java.lang.Object
org.openrewrite.DelegatingExecutionContext
org.openrewrite.maven.MavenExecutionContextView
- All Implemented Interfaces:
org.openrewrite.ExecutionContext
public class MavenExecutionContextView
extends org.openrewrite.DelegatingExecutionContext
-
Field Summary
Fields inherited from interface org.openrewrite.ExecutionContext
CURRENT_CYCLE, CURRENT_RECIPE, DATA_TABLES, REQUIRE_PRINT_EQUALS_INPUT, RUN_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCredentials(@Nullable MavenSettings mavenSettings) Get credentials set on this execution context, unless overridden by a supplied maven settings file.getMirrors(@Nullable MavenSettings mavenSettings) Get mirrors set on this execution context, unless overridden by a supplied maven settings file.getRepositories(@Nullable MavenSettings mavenSettings, @Nullable List<String> activeProfiles) Get repositories set on this execution context, unless overridden by a supplied maven settings file.@Nullable MavenSettingsrecordResolutionTime(Duration time) setActiveProfiles(List<String> activeProfiles) setCredentials(Collection<MavenRepositoryCredentials> credentials) setLocalRepository(MavenRepository localRepository) setMavenSettings(@Nullable MavenSettings settings, String... activeProfiles) setMirrors(@Nullable Collection<MavenRepositoryMirror> mirrors) setPinnedSnapshotVersions(Collection<ResolvedGroupArtifactVersion> pinnedSnapshotVersions) Require dependency resolution that encounters a matching group:artifact:version coordinate to resolve to a particular dated snapshot version, effectively making snapshot resolution deterministic.setPomCache(MavenPomCache pomCache) setRepositories(List<MavenRepository> repositories) setResolutionListener(ResolutionEventListener listener) static MavenExecutionContextViewview(org.openrewrite.ExecutionContext ctx) Methods inherited from class org.openrewrite.DelegatingExecutionContext
getMessage, getOnError, getOnTimeout, pollMessage, putMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.ExecutionContext
addObserver, computeMessage, getCycle, getCycleDetails, getMessage, getObservers, pollMessage, putCurrentRecipe, putMessageInCollection, putMessageInSet
-
Constructor Details
-
MavenExecutionContextView
public MavenExecutionContextView(org.openrewrite.ExecutionContext delegate)
-
-
Method Details
-
view
-
recordResolutionTime
-
getResolutionTime
-
setResolutionListener
-
getResolutionListener
-
setMirrors
public MavenExecutionContextView setMirrors(@Nullable @Nullable Collection<MavenRepositoryMirror> mirrors) -
getMirrors
-
getMirrors
public Collection<MavenRepositoryMirror> getMirrors(@Nullable @Nullable MavenSettings mavenSettings) Get mirrors set on this execution context, unless overridden by a supplied maven settings file.- Parameters:
mavenSettings- The maven settings defining mirrors to use, if any.- Returns:
- The mirrors to use for dependency resolution.
-
setCredentials
-
getCredentials
-
getCredentials
public Collection<MavenRepositoryCredentials> getCredentials(@Nullable @Nullable MavenSettings mavenSettings) Get credentials set on this execution context, unless overridden by a supplied maven settings file.- Parameters:
mavenSettings- The maven settings defining credentials (in its server configuration) to use, if any.- Returns:
- The credentials to use for dependency resolution.
-
setPomCache
-
getPomCache
-
setLocalRepository
-
getLocalRepository
-
setRepositories
-
getRepositories
-
getRepositories
public List<MavenRepository> getRepositories(@Nullable @Nullable MavenSettings mavenSettings, @Nullable @Nullable List<String> activeProfiles) Get repositories set on this execution context, unless overridden by a supplied maven settings file.- Parameters:
mavenSettings- The maven settings defining repositories to use, if any.activeProfiles- The active profiles to use, if any, with the accompanying maven settings.- Returns:
- The repositories to use for dependency resolution.
-
setPinnedSnapshotVersions
public MavenExecutionContextView setPinnedSnapshotVersions(Collection<ResolvedGroupArtifactVersion> pinnedSnapshotVersions) Require dependency resolution that encounters a matching group:artifact:version coordinate to resolve to a particular dated snapshot version, effectively making snapshot resolution deterministic.- Parameters:
pinnedSnapshotVersions- A set of group:artifact:version and the dated snapshot version to pin them to.
-
getPinnedSnapshotVersions
-
setActiveProfiles
-
getActiveProfiles
-
setMavenSettings
public MavenExecutionContextView setMavenSettings(@Nullable @Nullable MavenSettings settings, String... activeProfiles) -
getSettings
-