Class AuthConfigFactory


  • public class AuthConfigFactory
    extends Object
    Factory class to build an AuthConfig instance for a specific registry. Authentication information is retrieved from the Maven settings.
    • Constructor Detail

      • AuthConfigFactory

        public AuthConfigFactory​(org.apache.maven.settings.Settings mavenSettings,
                                 org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter)
        Constructs a new instance of this factory.
        Parameters:
        mavenSettings - The Maven Settings
        settingsDecrypter - The SettingsDecrypter in case authentication data is encrypted
    • Method Detail

      • getAuthConfigForRegistry

        public Optional<AuthConfig> getAuthConfigForRegistry​(String registry)
        Returns an Optional that may hold an instance of an AuthConfig class holding authentication information for the provided registry. Returns an Optional.empty() if no credentials could be found in the Maven settings
        Parameters:
        registry - The registry
        Returns:
        An Optional that may hold authentication data for the provided registry