ShrinkWrap Resolver Maven API 2.0.0-cr-1

org.jboss.shrinkwrap.resolver.api.maven
Interface MavenWorkingSession


public interface MavenWorkingSession

Encapsulates Maven session

Author:
Karel Piwko

Method Summary
 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 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)
           
 void setOffline(boolean offline)
          Whether or not to set this session in "offline" mode
 

Method Detail

getDependencyManagement

Set<MavenDependency> getDependencyManagement()
Gets a set af dependency declarations stored in version management. These dependency declarations are used to get versions if none are specified in MavenDependency#getAddress() address and also affect transitive dependency resolutions.

Returns:
Set of defined MavenDependencys

getDependenciesForResolution

List<MavenDependency> getDependenciesForResolution()
Gets the Set of dependencies to be resolved for this session

Returns:
MavenDependencys to be resolved as part of the request to the backend; may be a subset of getDeclaredDependencies() after pre-request filtering has been done

getDeclaredDependencies

Set<MavenDependency> getDeclaredDependencies()
Metadata for all defined elements

Returns:

loadPomFromFile

MavenWorkingSession loadPomFromFile(File pomFile,
                                    String... profiles)
                                    throws InvalidConfigurationFileException
Loads an effective POM file and updates session settings accordingly.

Parameters:
File - which represents Project Object Model file
profiles - List of profiles to activated/disabled
Returns:
Modified session instance
Throws:
InvalidConfigurationFileException

configureSettingsFromFile

MavenWorkingSession configureSettingsFromFile(File globalSettingsFile,
                                              File userSettingsFile)
                                              throws InvalidConfigurationFileException
Loads Maven configuration and updates session settings accordingly.

Parameters:
globalSettingsFile - File which represents global settings file
userSettingsFile - File which represents user settings file
Returns:
Modified session instance
Throws:
InvalidConfigurationFileException

resolveDependencies

Collection<MavenResolvedArtifact> resolveDependencies(MavenResolutionStrategy strategy)
                                                      throws ResolutionException
Throws:
ResolutionException

getParsedPomFile

ParsedPomFile getParsedPomFile()
Returns an abstraction of Project Object Model. This abstraction can be used to get additional information about the project

Returns:
Information about the project

regenerateSession

MavenWorkingSession regenerateSession()
Refreshes underlying Aether session in order to contain newly acquired information, such as new settings.xml content

Returns:
Modified session instance

setOffline

void setOffline(boolean offline)
Whether or not to set this session in "offline" mode

Parameters:
offline -

disableClassPathWorkspaceReader

void disableClassPathWorkspaceReader()
Disables the classpath workspace reader which may be used to resolve from dependencies on the ClassPath


disableMavenCentral

void disableMavenCentral()
Disables use of the Maven Central Repository


ShrinkWrap Resolver Maven API 2.0.0-cr-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.