-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-7743] Make the build work on JDK 20 #1065
Conversation
* the behaviour before the fix was already pretty confusing. JDK 19 and older do not check the presense of '{' in the constructor, so the URL object got created, but when converting to file the result would be e.g. '/../../src/test/remote-repo' which is completely wrong. But it seems the affected tests did not really care, as all of them were passing
} catch (MalformedURLException e) { | ||
throw new IllegalStateException(e); | ||
String repositoryUrl = repository.getUrl(); | ||
if (repositoryUrl.contains("${")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat ugly, but I haven't really found a better way at this point (without some major changes in how the TestRepositoryConnector
is being used}.
Basically either the TestRepositoryConnector
would need to resolve the properties in the URL, or the constructor would have to be called with a RemoteRepository
object which already has these resolved.
The single test that was failing (ProjectBuilderTest.testLocationTrackingResolution
) does not really care about the location as far as I can tell.
maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Yeikel <email@yeikel.com>
If you have some time would be good to backport it also |
* [MNG-7743] Make the build work on JDK 20 * the behaviour before the fix was already pretty confusing. JDK 19 and older do not check the presense of '{' in the constructor, so the URL object got created, but when converting to file the result would be e.g. '/../../src/test/remote-repo' which is completely wrong. But it seems the affected tests did not really care, as all of them were passing * Remove forgotten println Co-authored-by: Yeikel <email@yeikel.com> * Test with latest JDK * Do not run ITs with jdk 20, but just the "build itself" --------- Co-authored-by: Yeikel <email@yeikel.com> Co-authored-by: Guillaume Nodet <gnodet@gmail.com> # Conflicts: # .github/workflows/maven_build_itself.yml # maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java
Backported. Note that the build is broken on JDK 21 due to an incompatibility in spotless. |
### What changes were proposed in this pull request? This PR aims to upgrade Maven to 3.9.4. ### Why are the changes needed? Apache Maven community starts to test Java 20 officially. Although this is only about a test coverage, we had better adopt it because 3.8.x is not tested officially by Apache Maven community. - https://issues.apache.org/jira/browse/MNG-7743 - apache/maven#1065 Here are the release notes. - https://maven.apache.org/docs/3.9.0/release-notes.html - https://maven.apache.org/docs/3.9.1/release-notes.html - https://maven.apache.org/docs/3.9.2/release-notes.html - https://maven.apache.org/docs/3.9.3/release-notes.html - https://maven.apache.org/docs/3.9.4/release-notes.html ### How was this patch tested? Pass the CIs with Java 21 EA build Closes #1612 from dongjoon-hyun/ORC-1502. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This PR aims to upgrade Maven to 3.9.4. Apache Maven community starts to test Java 20 officially. Although this is only about a test coverage, we had better adopt it because 3.8.x is not tested officially by Apache Maven community. - https://issues.apache.org/jira/browse/MNG-7743 - apache/maven#1065 Here are the release notes. - https://maven.apache.org/docs/3.9.0/release-notes.html - https://maven.apache.org/docs/3.9.1/release-notes.html - https://maven.apache.org/docs/3.9.2/release-notes.html - https://maven.apache.org/docs/3.9.3/release-notes.html - https://maven.apache.org/docs/3.9.4/release-notes.html Pass the CIs with Java 21 EA build Closes #1612 from dongjoon-hyun/ORC-1502. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 20345a2) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
### What changes were proposed in this pull request? This PR aims to upgrade Maven to 3.9.4. ### Why are the changes needed? Apache Maven community starts to test Java 20 officially. Although this is only about a test coverage, we had better adopt it because 3.8.x is not tested officially by Apache Maven community. - https://issues.apache.org/jira/browse/MNG-7743 - apache/maven#1065 Here are the release notes. - https://maven.apache.org/docs/3.9.0/release-notes.html - https://maven.apache.org/docs/3.9.1/release-notes.html - https://maven.apache.org/docs/3.9.2/release-notes.html - https://maven.apache.org/docs/3.9.3/release-notes.html - https://maven.apache.org/docs/3.9.4/release-notes.html ### How was this patch tested? Pass the CIs with Java 21 EA build Closes apache#1612 from dongjoon-hyun/ORC-1502. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MNG-XXX] SUMMARY
,where you replace
MNG-XXX
andSUMMARY
with the appropriate JIRA issue.[MNG-XXX] SUMMARY
.Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.