-
Notifications
You must be signed in to change notification settings - Fork 81
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
Artifact of tag gets "-SNAPSHOT" added #229
Comments
Hi @dermoritz, I'm sorry but I don't get what versioning pattern you want to achieve. Could you give some samples. |
Sorry i was not very clear and even made a mistake.4 On MasterIf there is no tag yet: the version should be -SNAPSHOT If i tag the version: of tagged commit and artifact should be e.g. my first tag would be "0.0.1" then version is also "0.0.1 Commits on master after a Tag: -SNAPSHOT. So if the last tag on master is 0.0.1 i need to define to add something (not sure if possible). But for example i want always increase the last digit like "x.y.+1" the version should be "0.0.2-SNAPSHOT". In classic versioning you can define "next release" somewhere or how to derive next release from the current release - how is this possible here? BranchesVersion should always be -SNAPSHOT |
Your config will behaves as follows:
if you want to versioning by tag even if you are on a branch ( <configuration xmlns="https://github.com/qoomon/maven-git-versioning-extension"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/qoomon/maven-git-versioning-extension https://qoomon.github.io/maven-git-versioning-extension/configuration-9.1.0.xsd">
<refs considerTagsOnBranches="true">
<ref type="tag">
<pattern><![CDATA[v(?<version>.*)]]></pattern>
<version>${ref.version}</version>
</ref>
<ref type="branch">
<pattern>.+</pattern>
<version>${ref}-SNAPSHOT</version>
</ref>
</refs>
<!-- optional fallback configuration in case of no matching ref configuration-->
<rev>
<version>${commit}</version>
</rev>
</configuration> if you want to use the latest release tag version for your branch versions you need to use a branch config like this: <ref type="branch">
<pattern>.+</pattern>
<version>${describe.tag.version.core}-SNAPSHOT</version>
<describeTagPattern>v[0-9].+</describeTagPattern>
</ref> |
@dermoritz have a look at the [README.md] and search for then you could create a however I would suggest something like |
Thanks @qoomon for your detailed answers. in regards of ambiguous version for SNAPSHOT - this is the desired behavior for "SNAPSHOT". it is never stable. I will try you suggestions anyway. |
Regarding the snapshot builds you are totally right however you want to be able to distinguish between branch A snapshots and branch B snapshots therefore your should include the To get the version you could simply run
also see README.md |
I am glad that i found this "plugin" it is in fact my first "extension". More or less i copied from example without understanding.
What i want at the end is to reproduce the normal Maven way for versioning artifacts (mvn deploy goal):
master
branches
This is my current setup:
and for branches sadly including master it is working (master-SNAPSHOT).
But everything gets -SNAPSHOT added i tried with tag "0.1.0" and "v0.1.0". How to adopt the configuration to fulfill my requirements?
Thanks in advance
The text was updated successfully, but these errors were encountered: