@@ -823,21 +823,10 @@ public CreateArtifactResponse createArtifact(String groupId, IfArtifactExists if
823
823
firstVersionBranches = data .getFirstVersion ().getBranches ();
824
824
}
825
825
826
- // Don't actually do anything if "dryRun" is 'true'
827
- if (dryRun != null && dryRun ) {
828
- return CreateArtifactResponse .builder ()
829
- .artifact (ArtifactMetaData .builder ().groupId (groupId ).artifactId (artifactId )
830
- .createdOn (new Date ()).owner (securityIdentity .getPrincipal ().getName ())
831
- .modifiedBy (securityIdentity .getPrincipal ().getName ()).modifiedOn (new Date ())
832
- .name (artifactMetaData .getName ())
833
- .description (artifactMetaData .getDescription ())
834
- .labels (artifactMetaData .getLabels ()).artifactType (artifactType ).build ())
835
- .build ();
836
- }
837
-
838
826
Pair <ArtifactMetaDataDto , ArtifactVersionMetaDataDto > storageResult = storage .createArtifact (
839
827
new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , artifactType , artifactMetaData ,
840
- firstVersion , firstVersionContent , firstVersionMetaData , firstVersionBranches );
828
+ firstVersion , firstVersionContent , firstVersionMetaData , firstVersionBranches ,
829
+ dryRun != null && dryRun );
841
830
842
831
// Now return both the artifact metadata and (if available) the version metadata
843
832
CreateArtifactResponse rval = CreateArtifactResponse .builder ()
@@ -919,19 +908,9 @@ public VersionMetaData createArtifactVersion(String groupId, String artifactId,
919
908
ContentWrapperDto contentDto = ContentWrapperDto .builder ().contentType (ct ).content (content )
920
909
.references (referencesAsDtos ).build ();
921
910
922
- // Don't actually do anything if "dryRun" is 'true'
923
- if (dryRun != null && dryRun ) {
924
- return VersionMetaData .builder ().groupId (groupId ).artifactId (artifactId )
925
- .version (data .getVersion () == null ? "0" : data .getVersion ()).createdOn (new Date ())
926
- .owner (securityIdentity .getPrincipal ().getName ()).contentId (-1L )
927
- .name (metaDataDto .getName ()).description (metaDataDto .getDescription ())
928
- .labels (metaDataDto .getLabels ()).state (VersionState .ENABLED ).globalId (-1L )
929
- .artifactType (artifactType ).build ();
930
- }
931
-
932
911
ArtifactVersionMetaDataDto vmd = storage .createArtifactVersion (
933
912
new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , data .getVersion (), artifactType ,
934
- contentDto , metaDataDto , data .getBranches ());
913
+ contentDto , metaDataDto , data .getBranches (), dryRun != null && dryRun );
935
914
936
915
return V3ApiUtil .dtoToVersionMetaData (vmd );
937
916
}
@@ -1197,7 +1176,7 @@ private CreateArtifactResponse updateArtifactInternal(String groupId, String art
1197
1176
ContentWrapperDto contentDto = ContentWrapperDto .builder ().contentType (contentType ).content (content )
1198
1177
.references (referencesAsDtos ).build ();
1199
1178
ArtifactVersionMetaDataDto vmdDto = storage .createArtifactVersion (groupId , artifactId , version ,
1200
- artifactType , contentDto , metaData , branches );
1179
+ artifactType , contentDto , metaData , branches , false );
1201
1180
VersionMetaData vmd = V3ApiUtil .dtoToVersionMetaData (vmdDto );
1202
1181
1203
1182
// Need to also return the artifact metadata
0 commit comments