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 Details

    • wagons

      @Requirement private Map<String,org.apache.maven.wagon.Wagon> wagons
    • legacySupport

      @Requirement private org.apache.maven.plugin.LegacySupport legacySupport
    • settingsDecrypter

      @Requirement private org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter
    • ARCHETYPE_REPOSITORY_ID

      public static final String 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

      public static final String CENTRAL_REPOSITORY_ID
      See Also:
    • WILDCARD

      private static final String WILDCARD
      See Also:
    • EXTERNAL_WILDCARD

      private static final String 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:
      getArchetypeCatalog in interface ArchetypeDataSource
      Throws:
      ArchetypeDataSourceException
    • updateCatalog

      public void updateCatalog(org.apache.maven.project.ProjectBuildingRequest buildingRequest, Archetype archetype) throws ArchetypeDataSourceException
      Specified by:
      updateCatalog in interface ArchetypeDataSource
      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.WagonException
      IOException
      ArchetypeDataSourceException
    • 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

      private org.apache.maven.wagon.authentication.AuthenticationInfo getAuthenticationInfo(String id)
    • getProxy

      private org.apache.maven.wagon.proxy.ProxyInfo getProxy(String protocol)
    • getMirror

      private org.apache.maven.settings.Mirror getMirror(String repoId)
    • getMirror

      private org.apache.maven.settings.Mirror getMirror(String repoId, List<org.apache.maven.settings.Mirror> mirrors)
    • matchPattern

      static boolean matchPattern(String originalId, String pattern)
      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

      static boolean matchesLayout(String repoLayout, String mirrorLayout)
      Checks whether the layouts configured for a mirror match with the layout of the repository.
      Parameters:
      repoLayout - The layout of the repository, may be null.
      mirrorLayout - The layouts supported by the mirror, may be null.
      Returns:
      true if the layouts associated with the mirror match the layout of the original repository, false otherwise.