Class RemoteCatalogArchetypeDataSource
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.archetype.source.CatalogArchetypeDataSource
org.apache.maven.archetype.source.RemoteCatalogArchetypeDataSource
- All Implemented Interfaces:
ArchetypeDataSource, org.codehaus.plexus.logging.LogEnabled
@Component(role=ArchetypeDataSource.class,
hint="remote-catalog")
public class RemoteCatalogArchetypeDataSource
extends CatalogArchetypeDataSource
implements ArchetypeDataSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringId of the repository used to download catalog file.static final Stringprivate static final Stringprivate org.apache.maven.plugin.LegacySupportprivate org.apache.maven.settings.crypto.SettingsDecrypterprivate static final StringFields inherited from class CatalogArchetypeDataSource
ARCHETYPE_CATALOG_PROPERTYFields inherited from interface ArchetypeDataSource
ARCHETYPE_CATALOG_FILENAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddisconnectWagon(org.apache.maven.wagon.Wagon wagon) private ArchetypeCatalogdownloadCatalog(org.apache.maven.artifact.repository.ArtifactRepository repository) getArchetypeCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest) private org.apache.maven.wagon.authentication.AuthenticationInfoprivate org.apache.maven.settings.Mirrorprivate org.apache.maven.settings.Mirrorprivate org.apache.maven.wagon.proxy.ProxyInfoprivate org.apache.maven.wagon.Wagonprivate org.apache.maven.wagon.WagongetWagon(org.apache.maven.wagon.repository.Repository repository) (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(org.apache.maven.artifact.repository.ArtifactRepository repository, org.apache.maven.settings.Mirror mirror) (package private) static booleanmatchPattern(String originalId, String pattern) This method checks if the pattern matches the originalRepository.updateCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest, Archetype archetype) Methods inherited from class CatalogArchetypeDataSource
readCatalog, writeLocalCatalogMethods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
wagons
-
legacySupport
@Requirement private org.apache.maven.plugin.LegacySupport legacySupport -
settingsDecrypter
@Requirement private org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter -
ARCHETYPE_REPOSITORY_ID
Id of the repository used to download catalog file. Proxy or authentication info can be setup in settings.xml.- See Also:
-
CENTRAL_REPOSITORY_ID
- See Also:
-
WILDCARD
- See Also:
-
EXTERNAL_WILDCARD
- See Also:
-
-
Constructor Details
-
RemoteCatalogArchetypeDataSource
public RemoteCatalogArchetypeDataSource()
-
-
Method Details
-
getArchetypeCatalog
public ArchetypeCatalog getArchetypeCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest) throws ArchetypeDataSourceException - Specified by:
getArchetypeCatalogin interfaceArchetypeDataSource- Throws:
ArchetypeDataSourceException
-
updateCatalog
public File updateCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest, Archetype archetype) throws ArchetypeDataSourceException - Specified by:
updateCatalogin interfaceArchetypeDataSource- Throws:
ArchetypeDataSourceException
-
downloadCatalog
private ArchetypeCatalog downloadCatalog(org.apache.maven.artifact.repository.ArtifactRepository repository) throws org.apache.maven.wagon.WagonException, IOException, ArchetypeDataSourceException - Throws:
org.apache.maven.wagon.WagonExceptionIOExceptionArchetypeDataSourceException
-
disconnectWagon
private void disconnectWagon(org.apache.maven.wagon.Wagon wagon) -
getWagon
private org.apache.maven.wagon.Wagon getWagon(org.apache.maven.wagon.repository.Repository repository) throws org.apache.maven.wagon.UnsupportedProtocolException - Throws:
org.apache.maven.wagon.UnsupportedProtocolException
-
getWagon
private org.apache.maven.wagon.Wagon getWagon(String protocol) throws org.apache.maven.wagon.UnsupportedProtocolException - Throws:
org.apache.maven.wagon.UnsupportedProtocolException
-
getAuthenticationInfo
-
getProxy
-
getMirror
-
getMirror
-
matchPattern
This method checks if the pattern matches the originalRepository. Valid patterns: * = everything external:* = everything not on the localhost and not file based. repo,repo1 = repo or repo1 *,!repo1 = everything except repo1- Parameters:
originalId- to compare for a match.pattern- used for match. Currently only '*' is supported.- Returns:
- true if the repository is a match to this pattern.
-
matchesLayout
static boolean matchesLayout(org.apache.maven.artifact.repository.ArtifactRepository repository, org.apache.maven.settings.Mirror mirror) -
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.
-