Package org.apache.maven.settings

Examples of org.apache.maven.settings.Server


  private boolean hasServerSettings() {
    if (serverId == null) {
      return false;
    } else {
      final Server srv = settings.getServer(serverId);
      return srv != null;
    }
  }
View Full Code Here


        awsSecretKey = getDecryptedAwsKey(getSecretKey());
      } else if (hasServerSettings()) {
        /*
         * This actually is the right way...
         */
        Server server = settings.getServer(serverId);

        awsAccessKey = server.getUsername();
        awsSecretKey = getDecryptedAwsKey(server.getPassword().trim());
      } else {
        /*
         * Throws up. We have nowhere to get our credentials...
         */
        String errorMessage = "Entries in settings.xml for server "
View Full Code Here

  private boolean hasServerSettings() {
    if (serverId == null) {
      return false;
    } else {
      final Server srv = settings.getServer(serverId);
      return srv != null;
    }
  }
View Full Code Here

  static void configureWagon(Wagon wagon, String repositoryId,
      Settings settings, PlexusContainer container, Log log)
      throws WagonConfigurationException {
    // MSITE-25: Make sure that the server settings are inserted
    for (int i = 0; i < settings.getServers().size(); i++) {
      Server server = (Server) settings.getServers().get(i);
      String id = server.getId();
      if (id != null && id.equals(repositoryId)) {
        if (server.getConfiguration() != null) {
          final PlexusConfiguration plexusConf = new XmlPlexusConfiguration(
              (Xpp3Dom) server.getConfiguration());

          ComponentConfigurator componentConfigurator = null;
          try {
            componentConfigurator = (ComponentConfigurator) container
                .lookup(ComponentConfigurator.ROLE);
View Full Code Here

            if ( port > 0 )
            {
                host += ":" + port;
            }

            Server server = this.settings.getServer( host );

            if ( server != null )
            {
                if ( username == null )
                {
                    username = server.getUsername();
                }

                if ( password == null )
                {
                    password = decrypt( server.getPassword(), host );
                }

                if ( privateKey == null )
                {
                    privateKey = server.getPrivateKey();
                }

                if ( passphrase == null )
                {
                    passphrase = decrypt( server.getPassphrase(), host );
                }
            }
        }
    }
View Full Code Here

    return amazonEndpoint(computeEndpoint, computeEndpointFormat);
  }

  protected CarrotElasticCompute newElasticCompute() throws Exception {

    final Server server = settings().getServer(computeServerId);

    if (server == null) {
      throw new IllegalArgumentException(
          "server definition is missing for serverId="
              + computeServerId);
View Full Code Here

    /** */

    final String stackTemplate = safeTemplate(templateFile);

    /** */

    final Server server = settings().getServer(stackServerId);

    if (server == null) {
      throw new IllegalArgumentException(
View Full Code Here

   */
  private String dnsServerId;

  protected CarrotRoute53 newRoute53() throws Exception {

    final Server server = settings().getServer(dnsServerId);

    if (server == null) {
      throw new IllegalArgumentException(
          "server definition is missing for serverId=" + dnsServerId);
    }
View Full Code Here

                .setReleasePolicy(new RepositoryPolicy(true,
                        RepositoryPolicy.UPDATE_POLICY_ALWAYS,
                        RepositoryPolicy.CHECKSUM_POLICY_WARN));

        Settings settings = MavenSettings.getSettings();
        Server server = settings.getServer( repo.getId() );

        if ( server != null ) {
            remoteRepoBuilder.setAuthentication(
                    new AuthenticationBuilder()
                            .addUsername(server.getUsername())
                            .addPassword(server.getPassword())
                            .build());
        }

        return remoteRepoBuilder.build();
    }
View Full Code Here

    public void execute() throws MojoExecutionException {

        try {

            Server mavenServer = session.getSettings().getServer(server);

            if (mavenServer == null) {
                throw new MojoExecutionException("No server entry for '" + server + "', check your settings.xml file.");
            }

            final String groupId = session.getCurrentProject().getGroupId();
            final String artifactId = session.getCurrentProject().getArtifactId();
            final String version = session.getCurrentProject().getVersion();
            final String description = session.getCurrentProject().getDescription();

            String logon = mavenServer.getUsername() + ":" + mavenServer.getPassword();
            final String encodedLogon = new BASE64Encoder().encode(logon.getBytes());

            Xpp3Dom mavenServerConfiguration = (Xpp3Dom) mavenServer.getConfiguration();

            final String url = mavenServerConfiguration.getChild("url").getValue();

            final String baseVersion = version.replace("-SNAPSHOT", "");
            final String newVersion = String.format("%s-%s", artifactId, baseVersion);
View Full Code Here

TOP

Related Classes of org.apache.maven.settings.Server

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.