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

Provide a quicker command to see versions, add it to all sections #5639

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions content/doc/developer/publishing/releasing-cd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ You can see examples of the proposed snapshot and release versions in your case
+
[source,shell]
----
mvn validate
mvn validate -Dset.changelist -Dignore.dirt
mvn help:evaluate -Dexpression=project.version
mvn help:evaluate -Dexpression=project.version -Dset.changelist -Dignore.dirt
Comment on lines -155 to +156
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think leaving this as mvn validate is better, as it runs some additional checks which would help catch some kinds of mistakes. This is a one-time operation so a few extra seconds hardly matters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't validate part of basically any actual build?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course, but may as well check basic stuff before pushing a commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The benefit of the explicit help:evaluate is that it makes it easier to read the effective version, as it's not just a side effect of having lines like

[INFO] ----------< org.jenkins-ci.plugins:antisamy-markup-formatter >----------
[INFO] Building OWASP Markup Formatter Plugin 155.v795fb_8702324
[INFO] --------------------------------[ hpi ]---------------------------------

WDYT about mvn validate help:evaluate -Dexpression=project.version …? That way, towards the end of the build log, there would still be a line only containing the version number.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

----
+
IMPORTANT: Note that you will very quickly create releases with version numbers greater than 100, as the major version component corresponds to the number of commits in the branch you're releasing from.
Expand Down Expand Up @@ -193,6 +193,14 @@ This could be appropriate if you are leery of committing up front to having majo
with no option of going back to `maven-release-plugin`-style versioning except by starting at say `1000.1`,
because version numbers going forward must be mathematically larger than any currently on the update center.
+
You can see examples of the proposed snapshot and release versions in your case by running:
+
[source,shell]
----
mvn help:evaluate -Dexpression=project.version
mvn help:evaluate -Dexpression=project.version -Dset.changelist -Dignore.dirt
----
+
IMPORTANT: It is _not recommended_ to implement actual semantic versioning with automated releases performed by CD, as that requires great care in always changing the `revision` as part of the changes that semantically would require a `revision` change for the next release.
Otherwise, automated releases may have version numbers that semantically would not make sense.

Expand Down Expand Up @@ -223,6 +231,14 @@ Similar to the previous option, for a component whose version number ought to re
----
+
Here the version numbers will look like `4.0.0-123.vabcdef456789` or `4.0.0-999999-SNAPSHOT`, respectively.
You can see examples of the proposed snapshot and release versions in your case by running:
+
[source,shell]
----
mvn help:evaluate -Dexpression=project.version
mvn help:evaluate -Dexpression=project.version -Dset.changelist -Dignore.dirt
----
+
Use the `revision` property for the `<dependency>` declaration to ensure they always match:
+
[source,xml]
Expand Down