Skip to content

Commit d362d70

Browse files
authored
Merge pull request #10300 from Microsoft/users/aamallad/maven_fix_to_M150
Merge pull request #10283 from Microsoft/users/aamallad/maven_pkg_url…
2 parents 95607a4 + 6aee2ef commit d362d70

File tree

8 files changed

+14
-42
lines changed

8 files changed

+14
-42
lines changed

Tasks/MavenV2/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,5 @@
9191
"loc.messages.EntryAlreadyExists": "The settings for the feed or repository already exists in the xml file.",
9292
"loc.messages.EffectivePomInvalid": "Could not parse the effective POM.",
9393
"loc.messages.AuthenticationNotNecessary": "No built-in Maven feeds requiring authentication were found. Disable 'Authenticate built-in Maven feeds' for faster builds.",
94-
"loc.messages.UsingAuthFeed": "Using built-in feed: ",
95-
"loc.messages.OldStyleUrlsInPomFile": "Your POM file uses the old style of Azure DevOps organization URLs (i.e. https://*.visualstudio.com). Update your POM file to use the new URL style (https://dev.azure.com/*). Using credentials for the old URL style: %s"
94+
"loc.messages.UsingAuthFeed": "Using built-in feed: "
9695
}

Tasks/MavenV2/mavenutil.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,9 @@ async function collectFeedRepositories(pomContents:string): Promise<any> {
212212
tl.debug('packageUrl=' + packageUrl);
213213
let collectionName:string = url.parse(collectionUrl).hostname.toLowerCase();
214214
let collectionPathName = url.parse(collectionUrl).pathname;
215-
let oldCollectionName = ".pkgs.visualstudio.com";
216215
if(collectionPathName && collectionPathName.length > 1) {
217216
collectionName = collectionName + collectionPathName.toLowerCase();
218-
oldCollectionName = collectionPathName.replace(/\//g, "").toLowerCase() + oldCollectionName;
219217
tl.debug('collectionName=' + collectionName);
220-
tl.debug('oldCollectionName=' + oldCollectionName);
221218
}
222219
if (packageUrl) {
223220
url.parse(packageUrl).hostname.toLowerCase();
@@ -233,22 +230,14 @@ async function collectFeedRepositories(pomContents:string): Promise<any> {
233230
repo = repo instanceof Array ? repo[0] : repo;
234231
let url:string = repo.url instanceof Array ? repo.url[0] : repo.url;
235232
if (url && (url.toLowerCase().includes(collectionName) ||
236-
url.toLowerCase().includes(packageUrl))) {
233+
url.toLowerCase().includes(packageUrl) ||
234+
packagingLocation.PackagingUris.some(uri => url.toLowerCase().startsWith(uri.toLowerCase())))) {
237235
tl.debug('using credentials for url: ' + url);
238236
repos.push({
239237
id: (repo.id && repo.id instanceof Array)
240238
? repo.id[0]
241239
: repo.id
242240
});
243-
continue;
244-
}
245-
if (url && url.toLowerCase().includes(oldCollectionName)) {
246-
tl.warning(tl.loc('OldStyleUrlsInPomFile', url));
247-
repos.push({
248-
id: (repo.id && repo.id instanceof Array)
249-
? repo.id[0]
250-
: repo.id
251-
});
252241
}
253242
}
254243
}

Tasks/MavenV2/task.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 150,
21-
"Patch": 1
21+
"Patch": 2
2222
},
2323
"releaseNotes": "Configuration of the SonarQube analysis was moved to the [SonarQube](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube) or [SonarCloud](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud) extensions, in task `Prepare Analysis Configuration`",
2424
"demands": [
@@ -407,7 +407,6 @@
407407
"EntryAlreadyExists": "The settings for the feed or repository already exists in the xml file.",
408408
"EffectivePomInvalid": "Could not parse the effective POM.",
409409
"AuthenticationNotNecessary": "No built-in Maven feeds requiring authentication were found. Disable 'Authenticate built-in Maven feeds' for faster builds.",
410-
"UsingAuthFeed": "Using built-in feed: ",
411-
"OldStyleUrlsInPomFile": "Your POM file uses the old style of Azure DevOps organization URLs (i.e. https://*.visualstudio.com). Update your POM file to use the new URL style (https://dev.azure.com/*). Using credentials for the old URL style: %s"
410+
"UsingAuthFeed": "Using built-in feed: "
412411
}
413412
}

Tasks/MavenV2/task.loc.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 150,
21-
"Patch": 1
21+
"Patch": 2
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
2424
"demands": [
@@ -407,7 +407,6 @@
407407
"EntryAlreadyExists": "ms-resource:loc.messages.EntryAlreadyExists",
408408
"EffectivePomInvalid": "ms-resource:loc.messages.EffectivePomInvalid",
409409
"AuthenticationNotNecessary": "ms-resource:loc.messages.AuthenticationNotNecessary",
410-
"UsingAuthFeed": "ms-resource:loc.messages.UsingAuthFeed",
411-
"OldStyleUrlsInPomFile": "ms-resource:loc.messages.OldStyleUrlsInPomFile"
410+
"UsingAuthFeed": "ms-resource:loc.messages.UsingAuthFeed"
412411
}
413412
}

Tasks/MavenV3/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,5 @@
9292
"loc.messages.EffectivePomInvalid": "Could not parse the effective POM.",
9393
"loc.messages.AuthenticationNotNecessary": "No built-in Maven feeds requiring authentication were found. Disable 'Authenticate built-in Maven feeds' for faster builds.",
9494
"loc.messages.UsingAuthFeed": "Using built-in feed: ",
95-
"loc.messages.NoTestResults": "No test result files matching %s were found, so publishing JUnit test results is being skipped.",
96-
"loc.messages.OldStyleUrlsInPomFile": "Your POM file uses the old style of Azure DevOps organization URLs (i.e. https://*.visualstudio.com). Update your POM file to use the new URL style (https://dev.azure.com/*). Using credentials for the old URL style: %s"
95+
"loc.messages.NoTestResults": "No test result files matching %s were found, so publishing JUnit test results is being skipped."
9796
}

Tasks/MavenV3/mavenutil.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,9 @@ async function collectFeedRepositories(pomContents:string): Promise<any> {
211211
tl.debug('packageUrl=' + packageUrl);
212212
let collectionName:string = url.parse(collectionUrl).hostname.toLowerCase();
213213
let collectionPathName = url.parse(collectionUrl).pathname;
214-
let oldCollectionName = ".pkgs.visualstudio.com";
215214
if(collectionPathName && collectionPathName.length > 1) {
216215
collectionName = collectionName + collectionPathName.toLowerCase();
217-
oldCollectionName = collectionPathName.replace(/\//g, "").toLowerCase() + oldCollectionName;
218216
tl.debug('collectionName=' + collectionName);
219-
tl.debug('oldCollectionName=' + oldCollectionName);
220217
}
221218
if (packageUrl) {
222219
url.parse(packageUrl).hostname.toLowerCase();
@@ -232,22 +229,14 @@ async function collectFeedRepositories(pomContents:string): Promise<any> {
232229
repo = repo instanceof Array ? repo[0] : repo;
233230
let url:string = repo.url instanceof Array ? repo.url[0] : repo.url;
234231
if (url && (url.toLowerCase().includes(collectionName) ||
235-
url.toLowerCase().includes(packageUrl))) {
232+
url.toLowerCase().includes(packageUrl) ||
233+
packagingLocation.PackagingUris.some(uri => url.toLowerCase().startsWith(uri.toLowerCase())))) {
236234
tl.debug('using credentials for url: ' + url);
237235
repos.push({
238236
id: (repo.id && repo.id instanceof Array)
239237
? repo.id[0]
240238
: repo.id
241239
});
242-
continue;
243-
}
244-
if (url && url.toLowerCase().includes(oldCollectionName)) {
245-
tl.warning(tl.loc('OldStyleUrlsInPomFile', url));
246-
repos.push({
247-
id: (repo.id && repo.id instanceof Array)
248-
? repo.id[0]
249-
: repo.id
250-
});
251240
}
252241
}
253242
}

Tasks/MavenV3/task.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 3,
2020
"Minor": 150,
21-
"Patch": 1
21+
"Patch": 2
2222
},
2323
"releaseNotes": "Configuration of the SonarQube analysis was moved to the [SonarQube](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube) or [SonarCloud](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarcloud) extensions, in task `Prepare Analysis Configuration`",
2424
"demands": [
@@ -408,7 +408,6 @@
408408
"EffectivePomInvalid": "Could not parse the effective POM.",
409409
"AuthenticationNotNecessary": "No built-in Maven feeds requiring authentication were found. Disable 'Authenticate built-in Maven feeds' for faster builds.",
410410
"UsingAuthFeed": "Using built-in feed: ",
411-
"NoTestResults": "No test result files matching %s were found, so publishing JUnit test results is being skipped.",
412-
"OldStyleUrlsInPomFile": "Your POM file uses the old style of Azure DevOps organization URLs (i.e. https://*.visualstudio.com). Update your POM file to use the new URL style (https://dev.azure.com/*). Using credentials for the old URL style: %s"
411+
"NoTestResults": "No test result files matching %s were found, so publishing JUnit test results is being skipped."
413412
}
414413
}

Tasks/MavenV3/task.loc.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 3,
2020
"Minor": 150,
21-
"Patch": 1
21+
"Patch": 2
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
2424
"demands": [
@@ -408,7 +408,6 @@
408408
"EffectivePomInvalid": "ms-resource:loc.messages.EffectivePomInvalid",
409409
"AuthenticationNotNecessary": "ms-resource:loc.messages.AuthenticationNotNecessary",
410410
"UsingAuthFeed": "ms-resource:loc.messages.UsingAuthFeed",
411-
"NoTestResults": "ms-resource:loc.messages.NoTestResults",
412-
"OldStyleUrlsInPomFile": "ms-resource:loc.messages.OldStyleUrlsInPomFile"
411+
"NoTestResults": "ms-resource:loc.messages.NoTestResults"
413412
}
414413
}

0 commit comments

Comments
 (0)