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-6529 - ProjectBuild.build(projectsList, ...) ignores request.isResolveDependencies() #193
Conversation
@slachiewicz Is there anything else I should do to influence this to get in 3.6.1 (and even a 3.5.4 if possible)? |
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.
Awesome work.
Can you add the test as I am suggesting?
@@ -30,7 +32,8 @@ | |||
public class ProjectBuilderTest | |||
extends AbstractCoreMavenComponentTestCase | |||
{ | |||
protected String getProjectsDirectory() | |||
@Override | |||
protected String getProjectsDirectory() |
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.
Nit: remove spaces
MavenSession mavenSession = createMavenSession( null ); | ||
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest(); | ||
configuration.setRepositorySession( mavenSession.getRepositorySession() ); | ||
configuration.setResolveDependencies(true); |
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.
Can we add a test in which this is false and assert that resolution actually does not happen ?
Do you prefer an extra commit or should I squash them all in a single one? |
squash please |
notice I updated the code in the branch |
bb58484
to
501e2d8
Compare
Squashed, whitespace issue fixed, extra test added for |
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.
+1
Looks good to me
@@ -84,4 +87,39 @@ public void testVersionlessManagedDependency() | |||
// this is expected | |||
} | |||
} | |||
|
|||
public void testResolveDependencies() throws Exception { |
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.
please format unit tests with common style: this will improve maintenance
notice that the commit message should use the right method name: isResolveDependencies(), instead of isResolvedDependency() |
request.isResolveDependency
501e2d8
to
732e7de
Compare
@hboutemy Thanks, I updated the change according to your comments (I could have missed some style stuff though). |
sorry, I completely overlooked your answer |
Fix FlattenMojoTest on Windows
This adds a (failing) unit test showcasing that ProjectBuilder.build(List projects, boolean, ProjectBuildingRequest) doesn't honor ProjectBuildingRequest.isResolveDependencies().
And then it adds a fix that turns the test green.
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] - Fixes bug in ApproximateQuantiles
,where you replace
MNG-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in 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.