Skip to content

Commit 4df7718

Browse files
committed
fix: Support use with Pipeline Maven Integration Plugin
The Pipeline Maven Integration Plugin uses different paths for the archived artifacts than its workspace paths.
1 parent 81f6ad4 commit 4df7718

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/main/java/com/microsoft/jenkins/artifactmanager/AzureArtifactManager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void archive(FilePath workspace, Launcher launcher, BuildListener listene
138138
List<UploadObject> objects = new ArrayList<>();
139139

140140
Map<String, String> contentTypes = workspace
141-
.act(new ContentTypeGuesser(new ArrayList<>(artifacts.keySet()), listener));
141+
.act(new ContentTypeGuesser(new ArrayList<>(artifacts.values()), listener));
142142

143143
try {
144144
BlobContainerClient container = Utils.getBlobContainerReference(
@@ -147,15 +147,17 @@ public void archive(FilePath workspace, Launcher launcher, BuildListener listene
147147
true
148148
);
149149

150-
for (Map.Entry<String, String> entry : contentTypes.entrySet()) {
150+
for (Map.Entry<String, String> entry : artifacts.entrySet()) {
151151
String path = "artifacts/" + entry.getKey();
152152
String blobPath = getBlobPath(path);
153153

154154
BlobClient blobClient = container.getBlobClient(blobPath);
155155
String sas = generateSas(blobClient);
156156
String blobUrl = blobClient.getBlobUrl() + "?" + sas;
157157

158-
UploadObject uploadObject = new UploadObject(entry.getKey(), blobUrl, entry.getValue());
158+
UploadObject uploadObject = new UploadObject(
159+
entry.getValue(), blobUrl, contentTypes.get(entry.getValue()
160+
));
159161
objects.add(uploadObject);
160162
}
161163

0 commit comments

Comments
 (0)