Package com.microsoft.azure.maven.auth
Class MavenSettingHelper
- java.lang.Object
-
- com.microsoft.azure.maven.auth.MavenSettingHelper
-
public class MavenSettingHelper extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description privateMavenSettingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MavenAuthConfigurationbuildAuthConfigurationByServerId(org.apache.maven.execution.MavenSession session, org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter, String serverId)Build maven auth configuration from serverId.private static StringdecryptMavenSettingProperty(org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter, String propertyName, String value)private static StringgetPropertyValue(org.codehaus.plexus.util.xml.Xpp3Dom configuration, String property)Get string value from server configuration section in settings.xml.private static booleanisPropertyEncrypted(String value)
-
-
-
Method Detail
-
buildAuthConfigurationByServerId
public static MavenAuthConfiguration buildAuthConfigurationByServerId(org.apache.maven.execution.MavenSession session, org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter, String serverId) throws com.microsoft.azure.toolkit.lib.common.exception.InvalidConfigurationException, MavenDecryptException
Build maven auth configuration from serverId.- Parameters:
session- the maven sessionsettingsDecrypter- the decrypterserverId- the server id- Returns:
- the auth configuration
- Throws:
MavenDecryptException- when there are errors decrypting maven generated passwordcom.microsoft.azure.toolkit.lib.common.exception.InvalidConfigurationException- where are any illegal configurations
-
getPropertyValue
private static String getPropertyValue(org.codehaus.plexus.util.xml.Xpp3Dom configuration, String property)
Get string value from server configuration section in settings.xml.- Parameters:
configuration- theXpp3Domobject representing the configuration in <server>.property- the property name- Returns:
- String value if property exists; otherwise, return null.
-
isPropertyEncrypted
private static boolean isPropertyEncrypted(String value)
-
decryptMavenSettingProperty
private static String decryptMavenSettingProperty(org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter, String propertyName, String value) throws MavenDecryptException
- Throws:
MavenDecryptException
-
-