Skip to content

#1771: Change MvnUrlUpdater to extend GithubUrlReleaseUpdater#1781

Closed
jakozian wants to merge 1 commit intodevonfw:mainfrom
jakozian:fix/#1771-change-mvn-url-updater
Closed

#1771: Change MvnUrlUpdater to extend GithubUrlReleaseUpdater#1781
jakozian wants to merge 1 commit intodevonfw:mainfrom
jakozian:fix/#1771-change-mvn-url-updater

Conversation

@jakozian
Copy link
Contributor

This PR fixes #1771

Implemented changes:

  • Change MvnUrlUpdater to GithubUrlReleaseUpdater

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal

@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Mar 27, 2026
@jakozian jakozian added the internal Nothing to be added to CHANGELOG, only internal story label Mar 27, 2026
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 23647210327

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 25 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 70.375%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/url/tool/mvn/MvnUrlUpdater.java 25 0.0%
Totals Coverage Status
Change from base Build 23641462284: -0.03%
Covered Lines: 10800
Relevant Lines: 14740

💛 - Coveralls

@MarvMa
Copy link
Contributor

MarvMa commented Mar 27, 2026

When testing the changes I received the following Error. It seems like theres a whitespace in the URL.

14:21:49.432 [main] - ERROR - c.d.t.i.u.updater.AbstractUrlUpdater - Failed to perform HEAD request of URL https://archive.apache.org/dist/maven/maven-3/Maven 4.0.0-rc-3/binaries/apache-maven-Maven 4.0.0-rc-3-bin.tar.gz java.lang.IllegalArgumentException: Illegal character in path at index 51: https://archive.apache.org/dist/maven/maven-3/Maven 4.0.0-rc-3/binaries/apache-maven-Maven 4.0.0-rc-3-bin.tar.gz at java.base/java.net.URI.create(URI.java:936) at com.devonfw.tools.ide.url.updater.AbstractUrlUpdater.doCheckDownloadViaHeadRequest(AbstractUrlUpdater.java:508) at com.devonfw.tools.ide.url.updater.AbstractUrlUpdater.doAddVersionUrlIfNewAndValid(AbstractUrlUpdater.java:420) at com.devonfw.tools.ide.url.updater.AbstractUrlUpdater.doAddVersion(AbstractUrlUpdater.java:321) at com.devonfw.tools.ide.url.updater.AbstractUrlUpdater.doAddVersion(AbstractUrlUpdater.java:274) at com.devonfw.tools.ide.url.updater.AbstractUrlUpdater.doAddVersion(AbstractUrlUpdater.java:245) at com.devonfw.tools.ide.url.updater.AbstractUrlUpdater.doAddVersion(AbstractUrlUpdater.java:204) at com.devonfw.tools.ide.url.tool.mvn.MvnUrlUpdater.addVersion(MvnUrlUpdater.java:89) at com.devonfw.tools.ide.url.updater.JsonUrlUpdater.addVersion(JsonUrlUpdater.java:145) at com.devonfw.tools.ide.url.updater.JsonUrlUpdater.collectVersionsWithDownloadsFromJson(JsonUrlUpdater.java:97) at com.devonfw.tools.ide.url.updater.JsonUrlUpdater.update(JsonUrlUpdater.java:49) at com.devonfw.tools.ide.url.updater.UpdateManager.update(UpdateManager.java:133) at com.devonfw.tools.ide.url.updater.UpdateManager.update(UpdateManager.java:121) at com.devonfw.tools.ide.url.UpdateInitiator.main(UpdateInitiator.java:67) Caused by: java.net.URISyntaxException: Illegal character in path at index 51: https://archive.apache.org/dist/maven/maven-3/Maven 4.0.0-rc-3/binaries/apache-maven-Maven 4.0.0-rc-3-bin.tar.gz at java.base/java.net.URI$Parser.fail(URI.java:3003) at java.base/java.net.URI$Parser.checkChars(URI.java:3174) at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3256) at java.base/java.net.URI$Parser.parse(URI.java:3204) at java.base/java.net.URI.<init>(URI.java:649) at java.base/java.net.URI.create(URI.java:934) ... 13 common frames omitted

Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakozian thanks for your PR. Nice fix. 👍

Comment on lines +79 to +89
String downloadUrl = String.format(
"%s/dist/maven/%s/%s/binaries/%s-%s-%s-bin.tar.gz",
getDownloadBaseUrl(),
majorFolder,
version,
getGithubOrganization(),
getGithubRepository(),
version
);

doAddVersion(urlVersion, downloadUrl);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you see other UrlUpdaters since we already have a pattern replacement that should be reused?
See this code:

protected boolean doAddVersion(String edition, UrlVersion urlVersion, String url, OperatingSystem os, SystemArchitecture architecture, String checksum) {
UrlStatusFile status = urlVersion.getStatus();
if ((status != null) && status.getStatusJson().isManual()) {
return true;
}
String version = urlVersion.getName();
url = url.replace("${version}", version);
String major = urlVersion.getVersionIdentifier().getStart().getDigits();
url = url.replace("${major}", major);
if (os != null) {
url = url.replace("${os}", os.toString());
}
if (architecture != null) {
url = url.replace("${arch}", architecture.toString());
}
url = url.replace("${edition}", edition);
return doAddVersionUrlIfNewAndValid(edition, url, urlVersion, os, architecture, checksum);
}

@github-project-automation github-project-automation bot moved this from 🆕 New to 👀 In review in IDEasy board Mar 27, 2026
@hohwille hohwille mentioned this pull request Mar 27, 2026
7 tasks
@hohwille
Copy link
Member

Replaced by PR #1783 that added some small fixes.

@hohwille hohwille closed this Mar 27, 2026
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDEasy board Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Nothing to be added to CHANGELOG, only internal story

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Maven 3.9.1x versions not available

4 participants