Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing up for promote and drop mojo support.

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/branches/nexus-1.3.2/nexus-clients/nexus-restlight-clients@3848 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information...
commit 0bdb68b9add401ad44ef54bb48eb5d803caaf387 1 parent 6919c4f
jdcasey authored
View
2  nexus-restlight-client-common/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-client-common</artifactId>
View
2  nexus-restlight-m2-settings-client/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-m2-settings-client</artifactId>
View
2  nexus-restlight-stage-client/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-stage-client</artifactId>
View
35 ...-restlight-stage-client/src/main/java/org/sonatype/nexus/restlight/stage/StageClient.java
@@ -97,6 +97,24 @@ public StageClient( final String baseUrl, final String user, final String passwo
}
/**
+ * Retrieve the list of all closed (finished) staging repositories that may house artifacts with the specified
+ * groupId, artifactId, and version for the current user.
+ *
+ * @return details about each closed repository
+ */
+ public List<StageRepository> getOpenStageRepositoriesForUser( final String groupId, final String artifactId,
+ final String version )
+ throws RESTLightClientException
+ {
+ Map<String, String> params = new HashMap<String, String>();
+ mapCoord( groupId, artifactId, version, params );
+
+ Document doc = get( PROFILES_PATH, params );
+
+ return parseStageRepositories( doc, STAGE_REPO_XPATH, true );
+ }
+
+ /**
* Retrieve the details for the open staging repository which would be used for an artifact with the specified
* groupId, artifactId, and version if the current user deployed it. In the event Nexus returns multiple open
* staging repositories for the given user and GAV, this call will return details for the FIRST repository in that
@@ -175,9 +193,22 @@ public void finishRepositoryForUser( final String groupId, final String artifact
public void finishRepository( final StageRepository repo, final String description )
throws RESTLightClientException
{
- Element desc = new Element( REPO_DESCRIPTION_ELEMENT ).setText( description );
+ String descElementName =
+ getVocabulary().getProperty( VocabularyKeys.PROMOTE_STAGE_REPO_DESCRIPTION_ELEMENT,
+ VocabularyKeys.SUPPRESS_ELEMENT_VALUE );
+
+ List<Element> extras;
+ if ( !VocabularyKeys.SUPPRESS_ELEMENT_VALUE.equals( descElementName ) )
+ {
+ Element desc = new Element( REPO_DESCRIPTION_ELEMENT ).setText( description );
+ extras = Collections.singletonList( desc );
+ }
+ else
+ {
+ extras = null;
+ }
- performStagingAction( repo, STAGE_REPO_FINISH_ACTION, Collections.singletonList( desc ) );
+ performStagingAction( repo, STAGE_REPO_FINISH_ACTION, extras );
}
/**
View
12 ...stlight-stage-client/src/main/java/org/sonatype/nexus/restlight/stage/VocabularyKeys.java
@@ -32,6 +32,18 @@
* 1.3.2, the element has been simplified to <code>promoteRequest</code>.
*/
public static final String PROMOTE_STAGE_REPO_ROOT_ELEMENT = "promoteRepository.rootElement";
+
+ /**
+ * This is the description element name to use when finishing a staged repository. In Nexus Professional 1.3.1, it
+ * wasn't used at all, so the value is {@link VocabularyKeys#SUPPRESS_ELEMENT_VALUE}. In Nexus Professional 1.3.2+,
+ * the element is <code>description</code>.
+ */
+ public static final String PROMOTE_STAGE_REPO_DESCRIPTION_ELEMENT = "promoteRepository.descriptionElement";
+
+ /**
+ * Flag value that tells the REST client to suppress that element.
+ */
+ public static final String SUPPRESS_ELEMENT_VALUE = "NONE";
private VocabularyKeys()
{
View
2  nexus-restlight-test-harness/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-test-harness</artifactId>
View
2  ...test-harness/src/main/java/org/sonatype/nexus/restlight/testharness/AbstractRESTTest.java
@@ -24,7 +24,7 @@
private static final String TEST_NX_API_VERSION_SYSPROP = "test.nexus.api.version";
- private static final String DEFAULT_TEST_NX_API_VERSION = "1.3.1";
+ private static final String DEFAULT_TEST_NX_API_VERSION = "1.3.2";
/**
* <p>
View
7 pom.xml
@@ -4,11 +4,12 @@
<parent>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2</version>
</parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
+ <version>1.3.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Nexus Lightweight REST Clients</name>
@@ -26,7 +27,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nexus-restlight-client-common</artifactId>
- <version>${project.version}</version>
+ <version>1.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId> org.jdom</groupId>
@@ -83,7 +84,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nexus-restlight-test-harness</artifactId>
- <version>${project.version}</version>
+ <version>1.3.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Please sign in to comment.
Something went wrong with that request. Please try again.