public class MavenWorkingSessionImpl extends Object implements MavenWorkingSession
MavenWorkingSession
, encapsulating Maven/Aether backendConstructor and Description |
---|
MavenWorkingSessionImpl() |
Modifier and Type | Method and Description |
---|---|
MavenWorkingSession |
configureSettingsFromFile(File globalSettings,
File userSettings)
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
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
|
public Set<MavenDependency> getDependencyManagement()
MavenWorkingSession
MavenDependency#getAddress()
address and also affect transitive
dependency resolutions.getDependencyManagement
in interface MavenWorkingSession
MavenDependency
spublic List<MavenDependency> getDependenciesForResolution()
MavenWorkingSession
Set
of dependencies to be resolved for this sessiongetDependenciesForResolution
in interface MavenWorkingSession
MavenDependency
s to be resolved as part of the request to the backend; may be a subset of
MavenWorkingSession.getDeclaredDependencies()
after pre-request filtering has been donepublic Set<MavenDependency> getDeclaredDependencies()
elementsgetDeclaredDependencies
in interface MavenWorkingSession
MavenWorkingSession.getDeclaredDependencies()
public MavenWorkingSession loadPomFromFile(File pomFile, String... profiles) throws InvalidConfigurationFileException
MavenWorkingSession
loadPomFromFile
in interface MavenWorkingSession
pomFile
- which represents Project Object Model fileprofiles
- List of profiles to activated/disabledInvalidConfigurationFileException
public MavenWorkingSession configureSettingsFromFile(File globalSettings, File userSettings) throws InvalidConfigurationFileException
MavenWorkingSession
configureSettingsFromFile
in interface MavenWorkingSession
globalSettings
- File which represents global settings fileuserSettings
- File which represents user settings fileInvalidConfigurationFileException
public Collection<MavenResolvedArtifact> resolveDependencies(MavenResolutionStrategy strategy) throws ResolutionException
resolveDependencies
in interface MavenWorkingSession
ResolutionException
public MavenVersionRangeResult resolveVersionRange(MavenCoordinate coordinate) throws VersionResolutionException
MavenWorkingSession
resolveVersionRange
in interface MavenWorkingSession
VersionResolutionException
public ParsedPomFile getParsedPomFile()
MavenWorkingSession
getParsedPomFile
in interface MavenWorkingSession
public MavenWorkingSession regenerateSession()
MavenWorkingSession
regenerateSession
in interface MavenWorkingSession
public void setOffline(boolean offline)
MavenWorkingSession
setOffline
in interface MavenWorkingSession
public void disableClassPathWorkspaceReader()
disableClassPathWorkspaceReader
in interface MavenWorkingSession
MavenWorkingSession.disableClassPathWorkspaceReader()
public void disableMavenCentral()
disableMavenCentral
in interface MavenWorkingSession
MavenWorkingSession.disableMavenCentral()
Copyright © 2013 JBoss by Red Hat. All rights reserved.