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

[MNG-7838] Fix usage of older packaged artifacts from project local repository #1199

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

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Jul 7, 2023

JIRA issue: https://issues.apache.org/jira/browse/MNG-7838
IT PR: apache/maven-integration-testing#278

I'm not sure yet it solves the original reported problem though.

@gnodet
Copy link
Contributor Author

gnodet commented Jul 7, 2023

A similar problem can easily be reproduced in maven master:

> cd maven-settings
> mvn install
[INFO] --- japicmp:0.17.2:cmp (default) @ maven-settings ---
[WARNING] File 'maven-settings/target/classes/org/apache/maven/settings/WrapperList.class' is more recent than the packaged artifact for 'maven-settings', please run a full `mvn package` build
[WARNING] File 'maven-settings/target/classes/org/apache/maven/settings/WrapperList.class' is more recent than the packaged artifact for 'maven-settings', please run a full `mvn package` build
Listening for transport dt_socket at address: 8000
[INFO] Written file '/Users/gnodet/work/git/maven/maven-settings/target/japicmp/japicmp.diff'.
[INFO] Written file '/Users/gnodet/work/git/maven/maven-settings/target/japicmp/japicmp.xml'.
[INFO] Written file '/Users/gnodet/work/git/maven/maven-settings/target/japicmp/japicmp.html'.

In this case, the japicmp:cmp goal is executed after the jar goal, but before the install goal. And the artifacts are copied into the project local repo after the project is fully built. With this PR, the project's artifacts take precedence over the ones from the project local repo, so it actually fixes the above problem.

@gnodet
Copy link
Contributor Author

gnodet commented Jul 7, 2023

@rmannibucau it would be nice if you could build this branch and see if this reproduces your actual problem. A small reproducer project would be even better !

@rmannibucau
Copy link
Contributor

@gnodet does not look helping much (and didnt manage to get it functional), guess it is cause it does not take the highest "lastModified" value from [local-repo, m2/repo] - last one being the aether resolver indeed.

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