Skip to content
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

[MDEP-919] Try to fix a list-repositories for Maven 4 #386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slawekjaranowski
Copy link
Member

In debug ...

Maven 3.9.6

[DEBUG] Node: org.apache.maven.its.dependency:test:jar:1.0-SNAPSHOT resolved from:
[DEBUG]  - mrm-maven-plugin (http://localhost:55888, default, releases+snapshots) as mirror for:
[DEBUG]     - snapshots (http://localhost:55888, default, releases+snapshots)
[DEBUG]     - central (https://repo.maven.apache.org/maven2, default, releases)
[DEBUG]  - fake-remote-repository (http://localhost:2345, default, releases+snapshots)

Maven 4 (41d1950a6d8d88416ca7a34f82fbdf24bbafd9eb) I have:

[DEBUG] Node: org.apache.maven.its.dependency:test:jar:1.0-SNAPSHOT resolved from:
[DEBUG]  - mrm-maven-plugin (http://localhost:55825, default, releases+snapshots) as mirror for:
[DEBUG]     - snapshots (http://localhost:55825, default, releases+snapshots)
[DEBUG]  - fake-remote-repository (http://localhost:2345, default, releases+snapshots)

central is missing ...

What I should check, what debug ... @cstamas, @gnodet

@cstamas
Copy link
Member

cstamas commented Apr 25, 2024

Something has to be in this plugin... (or test env?)
I tried 3.9.6 + alpha-13 + current master w/ toolbox and output is pretty much same:
https://gist.github.com/cstamas/16450e9c636d579039170e7067217aac

@cstamas
Copy link
Member

cstamas commented Apr 25, 2024

Hm, when I build m-dep-p I had no interpolated-settings.xml? Is it deleted at IT run end?

@slawekjaranowski
Copy link
Member Author

Hm, when I build m-dep-p I had no interpolated-settings.xml? Is it deleted at IT run end?

it is a temporary file ....

@slawekjaranowski
Copy link
Member Author

try to add to settings something like:

   <mirrors>
       <mirror>
           <id>all-to-central</id>
           <name>Central as a mirror</name>
           <url>https://repo.maven.apache.org/maven2</url>
           <mirrorOf>external:*,!central,!repo.apache-snapshot,!repo.apache-stage,!oss-snap,!oss-staging</mirrorOf>
       </mirror>
   </mirrors>

@slawekjaranowski
Copy link
Member Author

Maven 4:
image

Maven 3
image

@cstamas @gnodet we have difference in result of mirroredRepositories

@cstamas
Copy link
Member

cstamas commented May 11, 2024

Will take a peek. In the meantime, what does toolbox list-repositories say?

@cstamas
Copy link
Member

cstamas commented May 11, 2024

@slawekjaranowski how to reproduce? Is this m-dep-p IT?

@slawekjaranowski
Copy link
Member Author

@slawekjaranowski how to reproduce? Is this m-dep-p IT?

Yes, there is src/it/projects/list-repositories

@slawekjaranowski
Copy link
Member Author

Toolbox propabbly doesn't use a getProject().getRemoteProjectRepositories()

https://github.com/maveniverse/mima/blob/main/context/src/main/java/eu/maveniverse/maven/mima/context/ContextOverrides.java#L36

@cstamas
Copy link
Member

cstamas commented May 11, 2024

It does, but it does via "middleman" the Context:
https://github.com/maveniverse/mima/blob/main/runtime/embedded-maven/src/main/java/eu/maveniverse/maven/mima/runtime/maven/MavenRuntime.java#L91
(which in case of Maven Runtime "runs embedded in maven" and project being present)

@cstamas
Copy link
Member

cstamas commented May 11, 2024

With current master (of both, m-dep-p and maven beta1) I have this UT failure:

[ERROR] Tests run: 18, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.465 s <<< FAILURE! -- in org.apache.maven.plugins.dependency.fromConfiguration.TestUnpackMojo
[ERROR] org.apache.maven.plugins.dependency.fromConfiguration.TestUnpackMojo.testUnpackOverWriteIfNewer -- Time elapsed: 0.050 s <<< FAILURE!

@slawekjaranowski
Copy link
Member Author

With current master (of both, m-dep-p and maven beta1) I have this UT failure:

[ERROR] Tests run: 18, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.465 s <<< FAILURE! -- in org.apache.maven.plugins.dependency.fromConfiguration.TestUnpackMojo
[ERROR] org.apache.maven.plugins.dependency.fromConfiguration.TestUnpackMojo.testUnpackOverWriteIfNewer -- Time elapsed: 0.050 s <<< FAILURE!

try to re-run, this test is flaky especially on MacOS

@cstamas
Copy link
Member

cstamas commented May 11, 2024

Ok, but am on Fedora 40, not MacOS

Edit: and it worked, this time test passed 🤷

@slawekjaranowski
Copy link
Member Author

@gnodet @cstamas Probably I found a reason of missing central repo on list.
https://issues.apache.org/jira/browse/MNG-4645 - we drop central repo from default super pom - so model doesn't have it

Next when list of repositories for project are build in method: org.apache.maven.project.DefaultProjectBuildingHelper#createArtifactRepositories

mirror repositories with the same ID are skipped so we lost info about mirroredRepositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants