jgitver / jgitver/jgitver-maven-plugin

jgitver extension not run by m2e incremental builds

Open
#147 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Groovy
Stars
166
Forks
42
PR merge metrics
No merged PRs in 30d

Description

## Issue

**version**: 1.7.1

**usage context**: Eclipse m2e

- [ ] eclipse: 2020-12 (4.18.0)
- [ ] m2e : Maven Integration for Eclipse 1.17.1.20201207-1112

I have a file generated, using jgitver variables
```xml

org.apache.maven.plugins
maven-resources-plugin
3.2.0


generate-version-template
generate-sources

copy-resources


${project.basedir}/info/


${project.basedir/templates}

latest_release.xml

true


UTF-8


```
where
```templates/latest_release.xml``` will look like this:

```xml

some.group.id
some.artifact.id
${jgitver.base_tag}

```

When running "run as maven install" in Eclipse, the file is generated and the version is substituted, as expected:

```info/latest_release.xml``` will look like this:
```xml

some.group.id
some.artifact.id
1.2.0

```

When pressing "save" on any project, Eclipse m2e will to an incremental build and the file will be recreated as:
```info/latest_release.xml```:
```xml

some.group.id
some.artifact.id
${jgitver.base_tag}

```
Clearly, m2e seems to __not__ run jgitver on an incremental build, so that the variables are not substituted.

As an effect, the files only look as they should for a few seconds between the "mvn install" and the automatic m2e incremental build.

I also cannot seem to force Eclipse e2e to invoke jgitver, using a lifecycle-mapping, like so, as the jgitver-extension does not seem to have a goal I could specify to run it:

```xml



org.eclipse.m2e
lifecycle-mapping
1.0.0





fr.brouillard.oss
jgitver-maven-plugin
[1.0.0,)

some-goal




true
true







```

The only solution that I came up with is to try to stop the resource filtering plugin using a lifecycle-mapping, but this would stop all filtering activities in a build.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.