public class MavenServerUtils extends Object
@Component private MavenSession session; @Component private PlexusContainer container;Then, instanciate a MavenServerUtils, and getServer informations from its id :
MavenServerUtils serverUtils = new MavenServerUtils(session, container);
ServerInformation serverInfos = serverUtils.getServerAuthentication("serverId");
| Constructor and Description |
|---|
MavenServerUtils(org.apache.maven.execution.MavenSession session,
org.codehaus.plexus.PlexusContainer container)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
ServerInformation |
getServerAuthentication(String serverId)
Returns authentication of specified server.
|
public MavenServerUtils(org.apache.maven.execution.MavenSession session,
org.codehaus.plexus.PlexusContainer container)
session - MavenSession to use. May be initialized with a @Component annotationcontainer - PlexusContainer to use. May be initialized with a @Component annotation.public ServerInformation getServerAuthentication(String serverId) throws org.apache.maven.plugin.MojoExecutionException
serverId is the value defined
in settings.xml :
<settings>
<servers>
<server>
<id>serverId</id>
</server>
</servers>
</settings>
serverId - The server identifier, as defined in settings.xmlorg.apache.maven.plugin.MojoExecutionException - If server does not exists in settings.xmlCopyright © 2018. All rights reserved.