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

Configuration #7

Open
jorgesilva15 opened this issue Jun 13, 2022 · 8 comments
Open

Configuration #7

jorgesilva15 opened this issue Jun 13, 2022 · 8 comments

Comments

@jorgesilva15
Copy link

I'm working with your plug in and was wondering if there's a way to omit some of the default values? As well as not entirely sure what the non qualifiers branches tag does

@ccampo133
Copy link
Owner

@jorgesilva15 what default values are you referring to. Could you provide more details please?

Regarding non-qualifier branches, the README states the following:

nonQualifierBranches: A comma separated list of branches for which no branch name qualifier will be used. Default "master". Example: master, integration

Qualifiers come from jgitver, which is the library that this plugin uses internally to calculate versions based on git information. Essentially, a qualifier is just metadata added to the version number (like the string SNAPSHOT) for example. Any version generated for a branch contained in the nonQualifierBranches list will not have any qualifiers applied to it.

For more details, please read up on the jgitver docs: https://github.com/jgitver/jgitver#versions-identifier--qualifiers

@jorgesilva15
Copy link
Author

The default to prerelease and dirty qualifier

@jorgesilva15
Copy link
Author

And then another question when merging back to let's say release and it's in the non qualifier list it wouldn't add 22.1.9-snapshot it would just be 22.1.9 right?

@ccampo133
Copy link
Owner

ccampo133 commented Jun 13, 2022

You cannot change the default pre-release and dirty qualifier without changing the code. You can however specify different ones in your pom.xml file (see the README), for example:

<plugin>
    <groupId>me.ccampo</groupId>
    <artifactId>git-version-maven-plugin</artifactId>
    <version>0.1.0</version>
    <extensions>true</extensions>
    <configuration>
        <strategy hint="git">
            <nonQualifierBranches>master</nonQualifierBranches>
            <preReleaseStage>CUSTOM_PRERELEASE_QUALIFIER</preReleaseStage>
            <dirtyQualifier>CUSTOM_DIRTY_QUALIFIER</dirtyQualifier>
            <snapshot>false</snapshot>
        </strategy>
    </configuration>
</plugin>

And then another question when merging back to let's say release and it's in the non qualifier list it wouldn't add 22.1.9-snapshot it would just be 22.1.9 right?

Yes that is correct.

@jorgesilva15
Copy link
Author

Thanks for clarifying! Final question, for the new generated pom would I have to do a script for it to replace the old one with the new generated one?

@ccampo133
Copy link
Owner

ccampo133 commented Jun 13, 2022

The version generated by the plugin with be included in the POM of the built module (e.g. jar file), not the actual POM itself. The actual pom.xml file should contain a placeholder version, such as <version>PLACEHOLDER</version>, and it will never need to be updated again.

The pom.xml.new-version file is mostly for illustration purposes and represents the POM actually used for the module when built (this is the POM others will see if they include your module as a dependency).

If you do not wish to retain this file, you can set the configuration parameter deleteTemporaryFile to true, and it will not be created:

<deleteTemporaryFile>true</deleteTemporaryFile>

I realize now some of the examples and documentation are a tiny bit out of date so I will get them updated :).

@jorgesilva15
Copy link
Author

Ah ok, so I'd have to manually update my own pom for future build use then in terms of development

@jorgesilva15
Copy link
Author

Thanks so much for the help!

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

No branches or pull requests

2 participants