Remove property keywords because of conflict in inline command configration parameters
Following this checklist to help us incorporate your contribution quickly and easily:
- [ ] Make sure there is a JIRA issue filed 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.
- [x] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Format the pull request title like
[MCHECKSTYLE-XXX] - Fixes bug in ApproximateQuantiles, where you replaceMCHECKSTYLE-XXXwith the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Run
mvn clean verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [x] You have run the integration tests successfully (
mvn -Prun-its clean verify).
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.
-
[x] 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.
Due to the property fields, when the mvn clean install command is executed, it applies the check command in the specified configurations, but when we run the mvn checkstyle:check command as an inline command, it cannot read the config variables in the pom because the property name and itself are different.
Example:
In pom.xml
<configuration> <configLocation>my_checks.xml</configLocation> </configuration>
But at the code:
@Parameter(property = "checkstyle.config.location", defaultValue = DEFAULT_CONFIG_LOCATION) = protected String configLocation;
You can see that configLocation and checkstyle.config.location conflicts
Because of checkstyle.config.location , mvn checkstyle:check command doesnt see the configureLocation.
Example: In pom.xml
<configuration> <configLocation>my_checks.xml</configLocation> </configuration>But at the code:@Parameter(property = "checkstyle.config.location", defaultValue = DEFAULT_CONFIG_LOCATION) = protected String configLocation;You can see that
configLocationandcheckstyle.config.locationconflictsBecause of checkstyle.config.location ,
mvn checkstyle:checkcommand doesnt see the configureLocation.
There is no conflicts .... simply properties is used to assign configuration values for not mentioned options If you have configuration in pom in static way - properties are not used any more ...
Example: In pom.xml
<configuration> <configLocation>my_checks.xml</configLocation> </configuration>But at the code:@Parameter(property = "checkstyle.config.location", defaultValue = DEFAULT_CONFIG_LOCATION) = protected String configLocation;You can see thatconfigLocationandcheckstyle.config.locationconflicts Because of checkstyle.config.location ,mvn checkstyle:checkcommand doesnt see the configureLocation.There is no conflicts .... simply properties is used to assign configuration values for not mentioned options If you have configuration in pom in static way - properties are not used any more ...
Yes, I know, but even though I have defined it statically in the pom, when I run it from cmd as mvn checkstyle:check, it does not see the configLocation section in the pom. If I run it as an inline command and I define it as static in the pom, only those with the same property name can be used. I followed the steps I saw in the checklist and when I removed the properties, there was no error and as far as I can see, it was fixed. Can you check it again?
When I run it inline and give statically configLocation in the pom, it cannot bind because the @Parameter porperty name is not the same with pom config name and than it uses the default value.
Also, when I delete only the properties in the @Parameter sections, the variable can still be used as a parameter in the inline command with its own name, that is, the names in the pom. Is this a problem? When I did this, it passed all the tests with mvn verify.
Please create JIRA issue for it with sample projects and instruction how to execute, what result is and what result is expected.
@talha-inozu, do you intend to work in this?