Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Sonatype Nexus (TM) Open Source Version
   * Copyright (c) 2007-2013 Sonatype, Inc.
   * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
   *
   * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
   * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
   *
   * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
  * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
  * Eclipse Foundation. All other trademarks are the property of their respective owners.
  */
 
 package org.sonatype.nexus.maven.staging.deploy;
 
 import java.util.Map;
 
 
Abstract class for deploy related mojos.

Author(s):
cstamas
Since:
1.0
 
 public abstract class AbstractDeployMojo
     extends AbstractStagingMojo
 {

  
Deploy strategies.
 
   @Component(role = DeployStrategy.class)
 
   // User configurable parameters
 
  
Specifies the profile ID on remote Nexus against which staging should happen. If not given, Nexus will be asked to perform a "match" and that profile will be used.
 
   @Parameter(property = "stagingProfileId")
   private String stagingProfileId;

  
Specifies the (opened) staging repository ID on remote Nexus against which staging should happen. If not given, Nexus will be asked to create one for us and that will be used.
 
   @Parameter(property = "stagingRepositoryId")
   private String stagingRepositoryId;

  
The key-value pairs to "tag" the staging repository.
 
   private Map<StringStringtags;

  
Controls whether the plugin remove or keep the staging repository that performed an IO exception during upload, hence, it's contents are partial Defaults to {{false}}. If {{true}}, even in case of upload failure, the staging repository (with partial content) will be left as is, left to the user to do whatever he wants.
 
   @Parameter(property = "keepStagingRepositoryOnFailure")
   private boolean keepStagingRepositoryOnFailure;

  
Set this to true to bypass staging repository closing at the workflow end.
 
   @Parameter(property = "skipStagingRepositoryClose")
   private boolean skipStagingRepositoryClose;

  
Set this to true to bypass staging features, and use deferred deploy features only.
 
   @Parameter(property = "skipStaging")
   private boolean skipStaging;
 
   // ==
 
  
Returns the deploy strategy by key (plexus component hint). If no given strategy found, org.apache.maven.plugin.MojoExecutionException is thrown.
 
   protected DeployStrategy getDeployStrategy(final String key)
       throws MojoExecutionException
   {
     final DeployStrategy deployStrategy = .get(key);
     if (deployStrategy == null) {
       throw new MojoExecutionException("DeployStrategy " + key + " not found!");
     }
     return deployStrategy;
   }

  
Builds the parameters instance.
  protected Parameters buildParameters()
      throws MojoExecutionException
  {
    try {
      // this below does not validate, it merely passes the set configuration values (even those unused)
      // each strategy will properly validated parameters in their prepare method
      final Parameters parameters = super.buildParameters();
      // add parameters defined on this level
      parameters.setStagingProfileId(getStagingProfileId());
      parameters.setTags(getTags());
      if (getLog().isDebugEnabled()) {
        getLog().debug(parameters.toString());
      }
      return parameters;
    }
    catch (MojoExecutionException e) {
      throw e;
    }
    catch (Exception e) {
      throw new MojoExecutionException("Bad configuration:" + e.getMessage(), e);
    }
  }
  // ==
  protected String getStagingProfileId() {
    return ;
  }
  protected String getStagingRepositoryId() {
    return ;
  }
  protected Map<StringStringgetTags() {
    return ;
  }
  protected boolean isKeepStagingRepositoryOnFailure() {
  }
  protected boolean isSkipStagingRepositoryClose() {
  }
  protected boolean isSkipStaging() {
    return ;
  }
New to GrepCode? Check out our FAQ X