Package org.apache.maven.bridge
Class MavenRepositorySystem
java.lang.Object
org.apache.maven.bridge.MavenRepositorySystem
@Component(role=MavenRepositorySystem.class,
hint="default")
public class MavenRepositorySystem
extends Object
- Since:
- 3.2.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArtifactHandlerManagerprivate static final Stringprivate static final Stringprivate Map<String, ArtifactRepositoryLayout> private static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArtifactRepositorystatic ArtifactRepositorystatic ArtifactRepositoryPolicyprivate voidcheckLayout(String repositoryId, String layoutId, ArtifactRepositoryLayout layout) createArtifactRepository(String id, String url, String layoutId, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) static ArtifactRepositorycreateArtifactRepository(String id, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) private Artifactprivate ArtifactcreateArtifactX(String groupId, String artifactId, String version, String scope, String type, String classifier, String inheritedScope) private ArtifactcreateArtifactX(String groupId, String artifactId, VersionRange versionRange, String type, String classifier, String scope, String inheritedScope) private ArtifactcreateArtifactX(String groupId, String artifactId, VersionRange versionRange, String type, String classifier, String scope, String inheritedScope, boolean optional) private ArtifactcreateDependencyArtifactX(String groupId, String artifactId, VersionRange versionRange, String type, String classifier, String scope, boolean optional) createExtensionArtifact(String groupId, String artifactId, String version) private ArtifactcreateExtensionArtifactX(String groupId, String artifactId, VersionRange versionRange) createLocalRepository(MavenExecutionRequest request, File localRepository) createParentArtifact(String groupId, String artifactId, String version) private ArtifactcreateParentArtifactX(String groupId, String artifactId, String version) createPluginArtifact(Plugin plugin) private ArtifactcreatePluginArtifactX(String groupId, String artifactId, VersionRange versionRange) createProjectArtifact(String groupId, String artifactId, String metaVersionId) private ArtifactcreateProjectArtifactX(String groupId, String artifactId, String version) private ArtifactcreateProjectArtifactX(String groupId, String artifactId, String version, String scope) createRepository(String url, String repositoryId, boolean releases, String releaseUpdates, boolean snapshots, String snapshotUpdates, String checksumPolicy) static RepositoryfromSettingsRepository(Repository settingsRepository) static RepositoryPolicyfromSettingsRepositoryPolicy(RepositoryPolicy settingsRepositoryPolicy) private AuthenticationgetAuthentication(org.eclipse.aether.RepositorySystemSession session, ArtifactRepository repository) private ArtifactRepositoryPolicygetEffectivePolicy(Collection<ArtifactRepositoryPolicy> policies) getEffectiveRepositories(List<ArtifactRepository> repositories) Source from org.apache.maven.repository.legacy.LegacyRepositorySystem#getEffectiveRepositoriesprivate ArtifactRepositoryLayoutstatic MirrorgetMirror(ArtifactRepository repository, List<Mirror> mirrors) private MirrorgetMirror(org.eclipse.aether.RepositorySystemSession session, ArtifactRepository repository) private ProxygetProxy(org.eclipse.aether.RepositorySystemSession session, ArtifactRepository repository) getRepoIds(List<ArtifactRepository> repositories) voidinjectAuthentication(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) voidinjectMirror(List<ArtifactRepository> repositories, List<Mirror> mirrors) private voidinjectMirror(ArtifactRepository repository, Mirror mirror) voidinjectMirror(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) voidinjectProxy(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) (package private) static booleanisExternalHttpRepo(ArtifactRepository originalRepository) Checks the URL to see if this repository refers to a non-localhost repository using HTTP.(package private) static booleanisExternalRepo(ArtifactRepository originalRepository) Checks the URL to see if this repository refers to an external repositoryprivate static boolean(package private) static booleanmatchesLayout(String repoLayout, String mirrorLayout) Checks whether the layouts configured for a mirror match with the layout of the repository.(package private) static booleanmatchesLayout(ArtifactRepository repository, Mirror mirror) (package private) static booleanmatchPattern(ArtifactRepository originalRepository, String pattern) This method checks if the pattern matches the originalRepository.
-
Field Details
-
artifactHandlerManager
-
layouts
@Requirement(role=ArtifactRepositoryLayout.class) private Map<String,ArtifactRepositoryLayout> layouts -
WILDCARD
- See Also:
-
EXTERNAL_WILDCARD
- See Also:
-
EXTERNAL_HTTP_WILDCARD
- See Also:
-
-
Constructor Details
-
MavenRepositorySystem
public MavenRepositorySystem()
-
-
Method Details
-
createArtifact
-
createProjectArtifact
-
createDependencyArtifact
-
createExtensionArtifact
-
createParentArtifact
-
createPluginArtifact
-
injectMirror
-
getMirror
private Mirror getMirror(org.eclipse.aether.RepositorySystemSession session, ArtifactRepository repository) -
injectMirror
public void injectMirror(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) -
injectMirror
-
getAuthentication
private Authentication getAuthentication(org.eclipse.aether.RepositorySystemSession session, ArtifactRepository repository) -
injectAuthentication
public void injectAuthentication(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) -
getProxy
private Proxy getProxy(org.eclipse.aether.RepositorySystemSession session, ArtifactRepository repository) -
injectProxy
public void injectProxy(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) -
getLayout
-
fromSettingsRepository
-
fromSettingsRepositoryPolicy
public static RepositoryPolicy fromSettingsRepositoryPolicy(RepositoryPolicy settingsRepositoryPolicy) -
buildArtifactRepository
public static ArtifactRepository buildArtifactRepository(Repository repo) throws InvalidRepositoryException - Throws:
InvalidRepositoryException
-
buildArtifactRepository
public static ArtifactRepository buildArtifactRepository(Repository repo) throws InvalidRepositoryException - Throws:
InvalidRepositoryException
-
buildArtifactRepositoryPolicy
-
createArtifactRepository
public ArtifactRepository createArtifactRepository(String id, String url, String layoutId, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) throws Exception - Throws:
Exception
-
checkLayout
private void checkLayout(String repositoryId, String layoutId, ArtifactRepositoryLayout layout) throws Exception - Throws:
Exception
-
createArtifactRepository
public static ArtifactRepository createArtifactRepository(String id, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) -
createArtifactX
-
createDependencyArtifactX
-
createProjectArtifactX
-
createParentArtifactX
-
createPluginArtifactX
private Artifact createPluginArtifactX(String groupId, String artifactId, VersionRange versionRange) -
createProjectArtifactX
-
createExtensionArtifactX
private Artifact createExtensionArtifactX(String groupId, String artifactId, VersionRange versionRange) -
createArtifactX
-
createArtifactX
-
createArtifactX
-
createDefaultRemoteRepository
public ArtifactRepository createDefaultRemoteRepository(MavenExecutionRequest request) throws Exception - Throws:
Exception
-
createRepository
public ArtifactRepository createRepository(String url, String repositoryId, boolean releases, String releaseUpdates, boolean snapshots, String snapshotUpdates, String checksumPolicy) throws Exception - Throws:
Exception
-
getRepoIds
-
getEffectiveRepositories
Source from org.apache.maven.repository.legacy.LegacyRepositorySystem#getEffectiveRepositories- Parameters:
repositories-- Returns:
- Since:
- 3.6.1
-
getEffectivePolicy
-
createLocalRepository
public ArtifactRepository createLocalRepository(MavenExecutionRequest request, File localRepository) throws Exception - Throws:
Exception
-
getMirror
-
matchPattern
This method checks if the pattern matches the originalRepository. Valid patterns:*(since 2.0.5)= everything,external:*(since 2.0.9)= everything not on the localhost and not file based,external:http:*(since 3.8.0)= any repository not on the localhost using HTTP,repo,repo1(since 2.0.9)=repoorrepo1,*,!repo1(since 2.0.9)= everything exceptrepo1.
- Parameters:
originalRepository- to compare for a match.pattern- used for match.- Returns:
- true if the repository is a match to this pattern.
-
isExternalRepo
Checks the URL to see if this repository refers to an external repository- Parameters:
originalRepository-- Returns:
- true if external.
-
isLocal
-
isExternalHttpRepo
Checks the URL to see if this repository refers to a non-localhost repository using HTTP.- Parameters:
originalRepository-- Returns:
- true if external.
-
matchesLayout
-
matchesLayout
Checks whether the layouts configured for a mirror match with the layout of the repository.- Parameters:
repoLayout- The layout of the repository, may benull.mirrorLayout- The layouts supported by the mirror, may benull.- Returns:
trueif the layouts associated with the mirror match the layout of the original repository,falseotherwise.
-