- 
          
- 
        Couldn't load subscription status. 
- Fork 302
DRAFT: feat(provider): add new maven provider for handling versions from pom.xml #963
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
base: master
Are you sure you want to change the base?
Conversation
| Codecov ReportAttention: Patch coverage is  
 
 Additional details and impacted files@@            Coverage Diff             @@
##           master     #963      +/-   ##
==========================================
+ Coverage   97.33%   97.41%   +0.07%     
==========================================
  Files          42       56      +14     
  Lines        2104     2360     +256     
==========================================
+ Hits         2048     2299     +251     
- Misses         56       61       +5     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. | 
| Glad to see people are finding the version provider useful. BUT, it has been design so extra provider can be created as separate plugins to avoid putting all the maintenance charge to the team. I don't know if the team is willing to support lots of providers for stacks they might not use and won't be able to maintain. My advice would be the following: publish this provider as a standalone  | 
| I agree, extra providers should be provided on a different repo 🙏🏻 | 
| I have been thinking a lot about this one. I think we need to apply our own recommendations, given we already support  Furthermore, I see benefit in externalizing those 3 providers: 
 WDYT ? | 
| @noirbizarre Thanks for going through the thought process behind externalizing a provider -- I understand the increased burden and stress of having to make updates to a provider you don't have any experience or proficiency in. I have a few semi-related questions: 
 | 
| 
 I think this is definitely something we want. We probably would want to remove them after 4.0 as this is a breaking change, but we could start making these providers as standalone packages and add deprecation warning in the main repo | 
| 
 Do you mean the version of  
 I though maven provider is only for finding where maven defines the version. Or am I missing anything? 
 @noirbizarre Not sure whether we have this support at this moment. 🤔 but may be something we can work on | 
| Thanks for the work @rshmhrj . Are you planning to create a package for this new provider?  Without the provider, how are you changing the version in the  <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.example</groupId>
    <artifactId>my-sdk</artifactId>
    <version commitizen="true">1.0.0</version>
    ...
</project>and then in  version_files = [
    "pom.xml:commitizen",
] | 
| as it is still marked as draft and the CI has not changed. I'll change it to draft | 
| Given the comments above, here's what I propose: 
 Perhaps we should make an org project to plan this properly and not forget anything | 
Description
Adding a new maven provider
Will also be looking into adding a maven version scheme (SemVer + Qualifier) for use in java projects
Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
On
cz inithave the option to choosemvnto read and write versions to thepom.xmlfileVersioning ref: https://octopus.com/blog/maven-versioning-explained
Steps to Test This Pull Request
pom.xmlin the root dirgit tag v0.0.1-SNAPSHOT)source /path_to_poetry_virtualenvs/commitizen-4BNoRlBJ-py3.12/bin/activatepython3 /path_to_commitizen_repo/commitizen/cli.py initmvnis now an option to choose fromCan currently successfully add with normal SemVer (minus qualifiers)

Additional context