Skip to content

Fixing ProjectReload with missing artifacts#7855

Merged
sdedic merged 3 commits intoapache:masterfrom
sdedic:maven/priming-reload-fixes
Jan 17, 2025
Merged

Fixing ProjectReload with missing artifacts#7855
sdedic merged 3 commits intoapache:masterfrom
sdedic:maven/priming-reload-fixes

Conversation

@sdedic
Copy link
Copy Markdown
Member

@sdedic sdedic commented Oct 9, 2024

It was discovered that if ProjectReload.withProjectState is used and the project contains a truly unresolvable artifact (i.e. a reference to a local custom build, that can be never downloaded), the priming support will keep telling the project state is not good. The past priming information (with an old timestamp) was incorrectly cached and has been merged with the new MavenProject, but degraded its timestamp ... so it was older than constituent files, which resulted in an inconsistent state right after load.

This PR extends the SPI to indicate that the ReloadImplementation should execute whenever previous ReloadImplementations changed anything. It also fixes various conditions with missing artifacts and project (re)loads - see the added test cases.

@sdedic sdedic added Maven [ci] enable "build tools" tests enterprise [ci] enable enterprise job labels Oct 9, 2024
@sdedic sdedic added this to the NB24 milestone Oct 9, 2024
@sdedic sdedic requested review from dbalek and mbien October 9, 2024 09:38
@sdedic sdedic self-assigned this Oct 9, 2024
Comment on lines +47 to +55
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>

<repository>
<id>gcn</id>
<url>https://maven.oracle.com/public</url>
</repository>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can this be reproduced without requiring two repos and so many dependencies?

unit tests shouldn't download entire demo applications if it is somehow avoidable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sorry for late response; I completely forgot about this one.
The bug was caught in this configuration / application. I need something that has a parent-POM and some other artifacts in a public repository; I might be able to trim down it a little.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mbien I've reduced dependncies in the test data projects and removed custom repositories. I've checked that the test + test data fails in the master; should succeed when fixed implemenation is present here in the branch.

@ebarboni ebarboni modified the milestones: NB24, NB25 Oct 22, 2024
@sdedic
Copy link
Copy Markdown
Member Author

sdedic commented Jan 16, 2025

Last call, will merge tonight if no objections.

@sdedic sdedic merged commit 763f668 into apache:master Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enterprise [ci] enable enterprise job Maven [ci] enable "build tools" tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants