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-6207] display build WARNING if deprecated 'system' scope is used #119

Conversation

dejan2609
Copy link
Contributor

@dejan2609 dejan2609 commented May 20, 2017

JIRA ticket: MNG-6207: Create WARNINGs in case of using system scope

Note: since system scope requires systemPath I decided to expand and rename existing systemPath tests; if that kind of change is not acceptable please suggest different approach.

@@ -604,17 +609,21 @@ public void testBadImportScopeClassifier()
"'dependencyManagement.dependencies.dependency.classifier' for test:a:pom:cls must be empty" );
}

public void testSystemPathRefersToProjectBasedir()
public void testSystemPathRefersToProjectBasedirAndDeprecatedScope()
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better having different test cases. Keeping the old test cases and create new ones for the changed behaviour. That makes it safe not to break previous behaviour,

@@ -411,14 +411,19 @@ public void testIncompleteParent()
assertTrue( result.getFatals().get( 2 ).contains( "parent.version" ) );
}

public void testHardCodedSystemPath()
public void testHardCodedSystemPathAndDeprecatedScope()
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better having different test cases. Keeping the old test cases and create new ones for the changed behaviour. That makes it safe not to break previous behaviour,

@dejan2609
Copy link
Contributor Author

dejan2609 commented May 21, 2017

New changes are pushed via new commit (all commits will be squashed into one eventually).
Solution is validated across different Maven versions (3.0.5, 3.1.1, 3.2.5, 3.3.9 and 3.5.0) and tested via small project using generated 3.5.1-SNAPSHOT.

Test renaming is recalled; however, it seems kind of reasonable (necessary ?) to fine-grain those test cases instead of adding a new one.
Rationale: since both existing test cases already consume pom.xml files with mutually dependent tags:

<scope>system</scope>
<systemPath>Some_Path</systemPath>

it seems convenient to carefully reuse those existing test cases, because both tags end up tested anyway (I reckon that adding a new test case with same two tags would be redundant).

@khmarbaise: let me know what you think (and please forgive me if my rationale is not that rational, I'll be ready to dig deeper and accommodate solution in order to fit standards).

Bonus question (in the unlikely case that I got it all right): does it make sense to introduce new ModelBuildingRequest VALIDATION_LEVEL_MAVEN (3_5 or 3_6) ?

@dejan2609
Copy link
Contributor Author

Just to narrow discussion to PR scope only and to eliminate bonus question: there is/was an initiative to increase validation level (MNG-6075 Increase the model validation level to the next minor level version).

@khmarbaise
Copy link
Member

Could you make a real commit log message like:

[MNG-6207] Create WARNINGs in case of using system scope
 If needed more description/explanations here.

Otherwise I need to do a git ci --amend ... which I would like to prevent and keep the original commit...

@dejan2609 dejan2609 force-pushed the MNG-6207-system-scope-deprecation-warning branch from 59ab313 to 7ce4ab9 Compare June 4, 2017 19:51
@dejan2609
Copy link
Contributor Author

@khmarbaise done, I altered commit messaged (added note about tests).

@khmarbaise
Copy link
Member

Sorry...Can please make the PR new based on the current master of the apache-maven, cause I didn't realized that this PR must be done before the other...Thanks in advance...

…ope 'system' declaration

Note about tests: existing 'systemPath' related tests are reused/expanded (rationale: scope 'system' and 'systemPath' are mutually dependent)
@dejan2609 dejan2609 force-pushed the MNG-6207-system-scope-deprecation-warning branch from 7ce4ab9 to 1ddb1f3 Compare June 7, 2017 20:44
@dejan2609
Copy link
Contributor Author

@khmarbaise Ok, I'll open new PR then.

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

Successfully merging this pull request may close these issues.

2 participants