maven-git-versioning-extension
maven-git-versioning-extension copied to clipboard
Runtim exception in azure devops pipeline
trafficstars
my config is as follows (also thanks to suggestions from https://github.com/qoomon/maven-git-versioning-extension/issues/229):
<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.4.0.xsd">
<refs>
<ref type="tag">
<pattern><![CDATA[v(?<version>.*)]]></pattern>
<version>${ref.version}</version>
</ref>
<ref type="branch">
<pattern>master</pattern>
<version>${describe.tag.version.major}.${describe.tag.version.minor}.${describe.tag.version.patch.next}-SNAPSHOT</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>
while locally (on master) the calculated version is "0.0.4-SNAPSHOT" - last tag + 1 in pipeline i get:
[INFO] --- me.qoomon:maven-git-versioning-extension:9.6.5 [core extension] ----
[INFO] matching ref: BRANCH - master
[INFO] ref configuration: BRANCH - pattern: master
[INFO] describeTagFirstParent: true
[INFO] version: ${describe.tag.version.major}.${describe.tag.version.minor}.${describe.tag.version.patch.next}-SNAPSHOT
[INFO]
[INFO] com.bosch.pt.hg.connectedcharger:cc-pipeline-test
[ERROR] Internal error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: couldn't find matching tag in shallow git repository -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: couldn't find matching tag in shallow git repository
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
in the pipeline it self i set
- task: Maven@4
env:
# env variables used by maven-git-versioning extension to version the artifacts
VERSIONING_GIT_REF: $(Build.SourceBranch)
VERSIONING_GIT_BRANCH: $(Build.SourceBranchName)
with this as version it is working: "${describe.tag.version}-SNAPSHOT" - it just uses the current / latest tag. but i want it do be increased.