public interface MavenWorkingSession
Modifier and Type | Method and Description |
---|---|
void |
addRemoteRepo(MavenRemoteRepository repository)
Adds a remote repository to use in resolution.
|
MavenWorkingSession |
configureSettingsFromFile(File globalSettingsFile,
File userSettingsFile)
Loads Maven configuration and updates session settings accordingly.
|
void |
disableClassPathWorkspaceReader()
Disables the classpath workspace reader which may be used to resolve from dependencies on the ClassPath
|
void |
disableMavenCentral()
Disables use of the Maven Central Repository
|
Set<MavenDependency> |
getDeclaredDependencies()
Metadata for all defined
<dependencies> elements |
List<MavenDependency> |
getDependenciesForResolution()
Gets the
Set of dependencies to be resolved for this session |
Set<MavenDependency> |
getDependencyManagement()
Gets a set af dependency declarations stored in version management.
|
ParsedPomFile |
getParsedPomFile()
Returns an abstraction of Project Object Model.
|
MavenWorkingSession |
loadPomFromFile(File pomFile,
String... profiles)
Loads an effective POM file and updates session settings accordingly.
|
MavenWorkingSession |
regenerateSession()
Refreshes underlying Aether session in order to contain newly acquired information, such as new settings.xml
content
|
Collection<MavenResolvedArtifact> |
resolveDependencies(MavenResolutionStrategy strategy) |
MavenVersionRangeResult |
resolveVersionRange(MavenCoordinate coordinate)
Resolves version range request for given coordinate
|
void |
setOffline(boolean offline)
Whether or not to set this session in "offline" mode
|
void |
useLegacyLocalRepository(boolean useLegacyLocalRepository)
Whether or not to track origin of artifacts present is local repository
|
Set<MavenDependency> getDependencyManagement()
Coordinate.toCanonicalForm()
and also affect transitive
dependency resolutions.MavenDependency
sList<MavenDependency> getDependenciesForResolution()
Set
of dependencies to be resolved for this sessionMavenDependency
s to be resolved as part of the request to the backend; may be a subset of
getDeclaredDependencies()
after pre-request filtering has been doneSet<MavenDependency> getDeclaredDependencies()
<dependencies>
elements<dependencies>
elementsMavenWorkingSession loadPomFromFile(File pomFile, String... profiles) throws InvalidConfigurationFileException
pomFile
- which represents Project Object Model fileprofiles
- List of profiles to activated/disabledInvalidConfigurationFileException
MavenWorkingSession configureSettingsFromFile(File globalSettingsFile, File userSettingsFile) throws InvalidConfigurationFileException
globalSettingsFile
- File which represents global settings fileuserSettingsFile
- File which represents user settings fileInvalidConfigurationFileException
Collection<MavenResolvedArtifact> resolveDependencies(MavenResolutionStrategy strategy) throws ResolutionException
ResolutionException
MavenVersionRangeResult resolveVersionRange(MavenCoordinate coordinate) throws VersionResolutionException
coordinate
- The coordinateVersionResolutionException
- If the version range request failsParsedPomFile getParsedPomFile()
MavenWorkingSession regenerateSession()
void setOffline(boolean offline)
offline
- Whether or not to set this session in "offline" modevoid disableClassPathWorkspaceReader()
void disableMavenCentral()
void useLegacyLocalRepository(boolean useLegacyLocalRepository)
useLegacyLocalRepository
- Whether to ignore origin of artifacts in local repository; defaults to falsevoid addRemoteRepo(MavenRemoteRepository repository)
repository
- The remote repositoryIllegalArgumentException
- if argument is nullCopyright © 2022 JBoss by Red Hat. All rights reserved.