jgitver-maven-plugin icon indicating copy to clipboard operation
jgitver-maven-plugin copied to clipboard

"-g" prefix option not available in maven plugin

Open otopetrik opened this issue 5 years ago • 1 comments

Before submitting an issue I have first:

  • [x] searched for similar already existing issue

Found completed issue in the underlying library https://github.com/jgitver/jgitver/issues/24.

The functionality does not seem to be exposed in jgitver-maven-plugin.

Issue

version: 1.5.1

usage context:

  • [x] maven command line: 3.6.0

Problem description:

  • with useGitCommitId set to true the generated name does not contain '-g' before the hash e.g. in repository one commit after v0.0.1 tag:
    • jgitver-maven-plugin produces ...-0.0.1-1-d1590b8f
    • sbt-git produces ...-0.0.1-1-gd1590b8

Attempts:

  • using <useLongFormat>true</useLongFormat> in xml configuration fails with:
Element 'useLongFormat' does not have a match in class fr.brouillard.oss.jgitver.cfg.Configuration
  • xsd does not contain "useLongFormat" or anything similar.
  • GitHub search for setUseLongFormat returns no results in jgitver-maven-plugin.

otopetrik avatar Dec 01 '19 02:12 otopetrik

Hi ! If you still want this I made this PATTERN conf workaround to achive this result.

<configuration xmlns="http://jgitver.github.io/maven/configuration/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jgitver.github.io/maven/configuration/1.1.0 https://jgitver.github.io/maven/configuration/jgitver-configuration-v1_1_0.xsd">
  <strategy>PATTERN</strategy>
  <versionPattern>${v}${-~meta.COMMIT_DISTANCE}${-g~meta.GIT_SHA1_8}</versionPattern>
</configuration>

n-peugnet avatar May 23 '20 19:05 n-peugnet