Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
OPEN - issue NXCM-2190: Problematic behavior of nexus-maven-plugin pa…
Browse files Browse the repository at this point in the history
…rameters in staging-build-promotion goal

https://issues.sonatype.org/browse/NXCM-2190

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/trunk/nexus@7133 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
velo committed Sep 8, 2010
1 parent 13a7bbc commit e17d3e7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
Expand Up @@ -61,6 +61,8 @@ public class StageClient

private static final String PROFILE_NAME_ELEMENT = "name";

private static final String PROFILE_MODE_ELEMENT = "mode";

private static final String REPO_ID_ELEMENT = "repositoryId";

private static final String REPO_URI_ELEMENT = "repositoryURI";
Expand Down Expand Up @@ -545,4 +547,46 @@ public List<StageRepository> getClosedStageRepositories()

return parseStageRepositories( doc, STAGE_REPO_LIST_XPATH, false, false );
}

/**
* Returns a list of all the staging profile Ids.
*
* @return
* @throws RESTLightClientException
*/
@SuppressWarnings( "unchecked" )
public List<StageProfile> getStageProfiles()
throws RESTLightClientException
{
Document doc = get( PROFILES_PATH );

// heavy lifting is done with xpath
XPath profileXp = newXPath( STAGE_REPO_XPATH );

List<Element> profiles;
try
{
profiles = profileXp.selectNodes( doc.getRootElement() );
}
catch ( JDOMException e )
{
throw new RESTLightClientException( "XPath selection failed: '" + STAGE_REPO_XPATH + "' (Root node: "
+ doc.getRootElement().getName() + ").", e );
}

List<StageProfile> result = new ArrayList<StageProfile>();
if ( profiles != null )
{
for ( Element profile : profiles )
{
// just pull out the id and name.
String profileId = profile.getChild( PROFILE_ID_ELEMENT ).getText();
String name = profile.getChild( PROFILE_NAME_ELEMENT ).getText();
String mode = profile.getChild( PROFILE_MODE_ELEMENT ).getText();

result.add( new StageProfile( profileId, name, mode ) );
}
}
return result;
}
}
Expand Up @@ -17,11 +17,22 @@ public class StageProfile
*/
private String name;

/**
* The profile mode
*/
private String mode;

public StageProfile( String profileId, String name )
{
this( profileId, name, null );
}

public StageProfile( String profileId, String name, String mode )
{
super();
this.profileId = profileId;
this.name = name;
this.mode = mode;
}

public String getProfileId()
Expand All @@ -34,4 +45,9 @@ public String getName()
return name;
}

public String getMode()
{
return mode;
}

}

0 comments on commit e17d3e7

Please sign in to comment.