@@ -160,7 +160,7 @@ public List<ArtifactReference> getArtifactVersionReferences(String groupId, Stri
160
160
String versionExpression , ReferenceType refType ) {
161
161
162
162
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
163
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
163
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
164
164
165
165
if (refType == null || refType == ReferenceType .OUTBOUND ) {
166
166
return storage
@@ -540,9 +540,9 @@ public void updateArtifactVersionContent(String groupId, String artifactId, Stri
540
540
HttpMethod .GET , (String []) null );
541
541
}
542
542
543
- // Resolve the GAV info
543
+ // Resolve the GAV info (only look for DRAFT versions)
544
544
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
545
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .SKIP_DISABLED_LATEST ));
545
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
546
546
547
547
// Ensure the artifact version is in DRAFT status
548
548
ArtifactVersionMetaDataDto vmd = storage .getArtifactVersionMetaData (gav .getRawGroupIdWithNull (),
@@ -586,7 +586,7 @@ public void deleteArtifactVersion(String groupId, String artifactId, String vers
586
586
requireParameter ("version" , version );
587
587
588
588
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), version ,
589
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
589
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
590
590
591
591
storage .deleteArtifactVersion (gav .getRawGroupIdWithNull (), gav .getRawArtifactId (),
592
592
gav .getRawVersionId ());
@@ -626,7 +626,7 @@ public void updateArtifactVersionMetaData(String groupId, String artifactId, Str
626
626
requireParameter ("versionExpression" , versionExpression );
627
627
628
628
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
629
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
629
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .SKIP_DISABLED_LATEST ));
630
630
631
631
EditableVersionMetaDataDto dto = new EditableVersionMetaDataDto ();
632
632
dto .setName (data .getName ());
@@ -645,7 +645,7 @@ public WrappedVersionState getArtifactVersionState(String groupId, String artifa
645
645
requireParameter ("version" , versionExpression );
646
646
647
647
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
648
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
648
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
649
649
650
650
VersionState state = storage .getArtifactVersionState (gav .getRawGroupIdWithNull (),
651
651
gav .getRawArtifactId (), gav .getRawVersionId ());
@@ -667,7 +667,7 @@ public void updateArtifactVersionState(String groupId, String artifactId, String
667
667
}
668
668
669
669
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
670
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
670
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
671
671
672
672
// Get current state.
673
673
VersionState currentState = storage .getArtifactVersionState (gav .getRawGroupIdWithNull (),
@@ -680,7 +680,7 @@ public void updateArtifactVersionState(String groupId, String artifactId, String
680
680
681
681
// If the current state is DRAFT, apply rules.
682
682
if (currentState == VersionState .DRAFT ) {
683
- VersionMetaData vmd = getArtifactVersionMetaData (gav .getRawGroupIdWithNull (),
683
+ VersionMetaData vmd = getArtifactVersionMetaData (gav .getRawGroupIdWithDefaultString (),
684
684
gav .getRawArtifactId (), gav .getRawVersionId ());
685
685
StoredArtifactVersionDto artifact = storage .getArtifactVersionContent (gav .getRawGroupIdWithNull (),
686
686
gav .getRawArtifactId (), gav .getRawVersionId ());
@@ -714,7 +714,7 @@ public Comment addArtifactVersionComment(String groupId, String artifactId, Stri
714
714
requireParameter ("versionExpression" , versionExpression );
715
715
716
716
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
717
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
717
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
718
718
719
719
CommentDto newComment = storage .createArtifactVersionComment (gav .getRawGroupIdWithNull (),
720
720
gav .getRawArtifactId (), gav .getRawVersionId (), data .getValue ());
@@ -737,7 +737,7 @@ public void deleteArtifactVersionComment(String groupId, String artifactId, Stri
737
737
requireParameter ("commentId" , commentId );
738
738
739
739
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
740
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
740
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
741
741
742
742
storage .deleteArtifactVersionComment (gav .getRawGroupIdWithNull (), gav .getRawArtifactId (),
743
743
gav .getRawVersionId (), commentId );
@@ -755,7 +755,7 @@ public List<Comment> getArtifactVersionComments(String groupId, String artifactI
755
755
requireParameter ("version" , version );
756
756
757
757
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), version ,
758
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
758
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
759
759
760
760
return storage .getArtifactVersionComments (gav .getRawGroupIdWithNull (), gav .getRawArtifactId (),
761
761
gav .getRawVersionId ()).stream ().map (V3ApiUtil ::commentDtoToComment ).collect (toList ());
@@ -779,7 +779,7 @@ public void updateArtifactVersionComment(String groupId, String artifactId, Stri
779
779
requireParameter ("value" , data .getValue ());
780
780
781
781
var gav = VersionExpressionParser .parse (new GA (groupId , artifactId ), versionExpression ,
782
- (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .DEFAULT ));
782
+ (ga , branchId ) -> storage .getBranchTip (ga , branchId , RetrievalBehavior .ALL_STATES ));
783
783
784
784
storage .updateArtifactVersionComment (gav .getRawGroupIdWithNull (), gav .getRawArtifactId (),
785
785
gav .getRawVersionId (), commentId , data .getValue ());
@@ -1227,13 +1227,6 @@ private CreateArtifactResponse handleIfExists(String groupId, String artifactId,
1227
1227
switch (ifExists ) {
1228
1228
case CREATE_VERSION :
1229
1229
return updateArtifactInternal (groupId , artifactId , theVersion );
1230
- // case RETURN:
1231
- // GAV latestGAV = storage.getBranchTip(new GA(groupId, artifactId), BranchId.LATEST,
1232
- // ArtifactRetrievalBehavior.DEFAULT);
1233
- // ArtifactVersionMetaDataDto latestVersionMD =
1234
- // storage.getArtifactVersionMetaData(latestGAV.getRawGroupIdWithNull(),
1235
- // latestGAV.getRawArtifactId(), latestGAV.getRawVersionId());
1236
- // return V3ApiUtil.dtoToVersionMetaData(latestVersionMD);
1237
1230
case FIND_OR_CREATE_VERSION :
1238
1231
return handleIfExistsReturnOrUpdate (groupId , artifactId , theVersion , canonical );
1239
1232
default :
0 commit comments