jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Mojo Build Number Maven Plugin
  • Mojo Build Number Maven Plugin
  • MBUILDNUM-86

Short Revision Id for Git SCM

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1
  • Labels:
    None
  • Environment:
    only Git support
  • Patch Submitted:
    Yes
  • Number of attachments :
    3

Description

The main idea of this feature is to provide an additional parameter to buildNumeber plugin to get out from SCM the short revision number.
Exemple - the git 'normal' commit ID is something like this : b0c1c69be579175e63eeb1c056d607f01ab61e96
What the improvement should do is to take the parameter <shortRevisionLength>5</shortRevisionLength> from the config and ask the command git rev-parse --short=5 to give a short id. The result should be b0c1c.

The work I made consists of 2 separate patches:
1. BuildNumberPlugin
2. maven-scm-plugin 1.7-SNAPSHOT

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    patchBuildNumber-ShortRevisionLength.txt
    07/Feb/12 1:05 PM
    4 kB
    Voronetskyy Yevgen
  2. Text File
    patch-MBuild-GitShortRev-Documentation.txt
    08/Feb/12 8:05 AM
    2 kB
    Voronetskyy Yevgen
  3. Text File
    patch-readonly.txt
    10/Apr/12 2:54 AM
    0.6 kB
    Voronetskyy Yevgen

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Voronetskyy Yevgen added a comment - 07/Feb/12 1:14 PM

The associated issue request for maven-scm plugin with a patch is here : http://jira.codehaus.org/browse/SCM-664

Show
Voronetskyy Yevgen added a comment - 07/Feb/12 1:14 PM The associated issue request for maven-scm plugin with a patch is here : http://jira.codehaus.org/browse/SCM-664
Hide
Permalink
Olivier Lamy added a comment - 08/Feb/12 7:20 AM

fixed r15918.
Thanks !

Show
Olivier Lamy added a comment - 08/Feb/12 7:20 AM fixed r15918. Thanks !
Hide
Permalink
Voronetskyy Yevgen added a comment - 08/Feb/12 8:05 AM

In order to finalize the improvement for short Git id, I send a patched usage.apt.vm file for the accuracy in the plugin documentation page.

Show
Voronetskyy Yevgen added a comment - 08/Feb/12 8:05 AM In order to finalize the improvement for short Git id, I send a patched usage.apt.vm file for the accuracy in the plugin documentation page.
Hide
Permalink
Olivier Lamy added a comment - 08/Feb/12 8:22 AM

applied too.
Thanks !

Show
Olivier Lamy added a comment - 08/Feb/12 8:22 AM applied too. Thanks !
Hide
Permalink
Voronetskyy Yevgen added a comment - 10/Apr/12 2:49 AM

Some people have the following exception :
[INFO] Error configuring: org.codehaus.mojo:buildnumber-maven-plugin. Reason: ERROR: Cannot override read-only parameter: shortRevisionLength in goal: buildnumber:create

I could not reproduce this behavior in my projects, but it seems very possible.

The person who encountered this has been modified the generated META-INF/maven/plugin.xml to make the shortRevisionLength editable = true.

I looked at CreateMojo.java and actually the field shortRevisionLength has the @readonly annotation.

This annotation should be removed.

Show
Voronetskyy Yevgen added a comment - 10/Apr/12 2:49 AM Some people have the following exception : [INFO] Error configuring: org.codehaus.mojo:buildnumber-maven-plugin. Reason: ERROR: Cannot override read-only parameter: shortRevisionLength in goal: buildnumber:create I could not reproduce this behavior in my projects, but it seems very possible. The person who encountered this has been modified the generated META-INF/maven/plugin.xml to make the shortRevisionLength editable = true. I looked at CreateMojo.java and actually the field shortRevisionLength has the @readonly annotation. This annotation should be removed.
Hide
Permalink
Olivier Lamy added a comment - 10/Apr/12 3:21 AM

good catch. fixed r16316.
Thanks!

Show
Olivier Lamy added a comment - 10/Apr/12 3:21 AM good catch. fixed r16316. Thanks!

People

  • Assignee:
    Olivier Lamy
    Reporter:
    Voronetskyy Yevgen
Vote (0)
Watch (0)

Dates

  • Created:
    07/Feb/12 1:05 PM
    Updated:
    10/Apr/12 3:21 AM
    Resolved:
    10/Apr/12 3:21 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.