-
Notifications
You must be signed in to change notification settings - Fork 304
#310: Only properties created by maven-git-commit-id-plugin filtered. #311
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
#310: Only properties created by maven-git-commit-id-plugin filtered. #311
Conversation
80d6691 to
4045457
Compare
…gin filtered now.
4045457 to
993f265
Compare
|
Hi thank you for reporting the issue and creating a pull request! The PR looks ok, but I'll definitely need to look into that further to check if other items of the plugin would be affected by this as well. Also would be nice to have a testcase for this since it is something more critical ;-) |
|
Yes you are right I will create a unit test for. |
|
Ok, I moved the filtering into a collaborator (PropertiesFilterer) and added a unit test. This solves the issue and adds test coverage. Additionally we could do a refactoring related to working on the project properties. We could change initProperties() to always return a new Properties instance, generate the properties, do the replacement, filtering etc. and "publish" the result into the project properties as it is already done in https://github.com/ktoso/maven-git-commit-id-plugin/blame/master/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java#L383 . What do you think about that change? |
|
Thanks for the test cases! It seems that the Please add the refactoring and I'll pull in the changes.... |
…object now and publishes results when done.
|
Moved replacement code into PropertiesReplacer with own test and added the refactoring described above. The refactoring changes behaviour! What is the intend behind the properties replacement? Should it be performed on project wide properties? |
|
Actually its a really good question on what properties the replacement should perform. The initial intent comes from here #138. In a nutshell a branch has a name like "feature/feature_name" and someone wanted to use the branch-name in the finalName of the artifact. However the character "/" is not valid as filename and thus this would not work. Based on what I wrote inside the docs (1e8b523) the replacement can be used to replace certain characters or strings using regular expressions within the generated git properties. I even added the following note I would say at the time being it is sufficient to have the replacement only work on the properties generated by the plugin (that is pretty much what the readme says about the functionality). Just for reference: TLDRAll changes look good to me! |
|
Thanks for merging! I am glad I could contribute and give something back in return. |
|
Thanks @cbuschka ! This is now released as 2.2.3, have fun! :) |
Added extra checks if a property has been generated by maven-git-commit-id-plugin before filtering. This fixes issue 310.