-
Notifications
You must be signed in to change notification settings - Fork 81
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
[SHRINKRES-351] enh: using maven 4 project-local dependency resolution, if available #341
Conversation
edf90bb
to
c929aeb
Compare
116461b
to
c91eff1
Compare
@petrberan Ready to go! |
db584fe
to
c83276c
Compare
ping :) |
Hi @lprimak , sorry about the wait, I was preoccupied with a different issue and it's just now that I can have a look at your PRs. I wasn't actually able to find anything in Maven 4 related to project local dependencies and its changes against Maven 3. Do you happen to have some documentation for that? |
@@ -85,8 +85,9 @@ private void extractFileInDestinationDir() { | |||
} catch (IOException e) { | |||
System.err.println("Failed to unzip file: " + e.getMessage()); | |||
} | |||
markerFileHandler.deleteMarkerFile(); | |||
System.out.printf("Resolver: Successfully extracted maven binaries from %s%n", fileToExtract); | |||
if (markerFileHandler.deleteMarkerFile()) { |
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.
Even though this is just a simple print, I wouldn't make printing the line dependent on deleting the file. Especially if the file is not related to the actual extraction
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 because I was trying to fix flaky test that relies on this message.
Failing to delete marker file indicates a failure in the code, at least that's how I am reading this,
so actual functionality should be correct.
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.
Got it, found the test. Must admit, not my favorite way of checking whether the file was extracted, but I can understand this change.
Can I ask you to put this in a separate commit? As this isn't related to the project-local dependencies I'd prefer git blame to show a related commit when it comes to checking history of this change
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.
yes
@@ -35,7 +35,7 @@ void testDaemonShouldWaitForBuildSuccess() throws TimeoutException { | |||
.withWaitUntilOutputLineMatches(".*BUILD SUCCESS.*") | |||
.build(); | |||
|
|||
Awaitility.await("Wait till thread is not be alive").atMost(20, TimeUnit.SECONDS) | |||
Awaitility.await("Wait till thread is not be alive").atMost(45, TimeUnit.SECONDS) |
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.
Why increasing the timeout? Did the changes in the PR resulted in longer run?
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.
Same here, I noticed flaky test in CI. Has nothing to do with the changes in this PR, just trying to fix flakiness as I see it :)
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.
Sounds good to me. Can I ask for a separate commit here as well?
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.
Yes, I will do that. thanks
No problem at all!
The only thing I could find is this: https://issues.apache.org/jira/browse/MNG-7629 |
Managed to have a look and the code looks solid, thank you @lprimak . One thing I'd like to discuss here is the introduction of The thing that doesn't sit well with me is that this is enabled by default and this could lead to potential backward compatibility issues, as opposed if this was disabled by default and enabled once we support Maven 4. WDYT? |
Thank you!
So there is a lot of thought and risk mitigation that went into this. Basically, there are two opposing forces at work here, "works out of the box" and "compatibility" Typically maven version is chosen by the users' environment. Both maven 3 and 4 users may work with the same project. What that means is that per-project configuration of the resolver is impractical. The only "issue" I can see if there is a mixed directory structure, and somehow So, there is only a minuscule risk, and in this case I like to introduce a way to turn off new functionality, which is exactly what I did here. |
6f0a19b
to
595f5a1
Compare
flaky test fixes are in a separate commit now |
595f5a1
to
b6f8d08
Compare
Understood, thank you for the explanation @lprimak . In the end, we can always file an issue and fix it afterwards, so I don't think there's anything preventing us from merging this. I'll merge this and release a 3.3.2 next week if you don't mind as I'm not a fan of releasing on Friday, if that's fine :) Do you want to pursue #340 any further or can that be closed? |
Merging, thank you @lprimak |
Uses Maven 4 project-local repository to resolve articles, if available
Compatible with both maven 3 and maven 4
Maven 4 is not required and no dependencies are changed
Added 2 system properties to control new features (described in the README):
org.jboss.shrinkwrap.resolver.maven.skipCompilation
: Flag to skip compilation of resolved artifacts (true/false) - default is false.org.jboss.shrinkwrap.resolver.maven.disableProjectLocal
: Flag to disable Maven 4 project-local repository (true/false) - default is false.fixes #330