Open Brixomatic opened 3 years ago
As it looks to be a m2e issue what do you expect from jgitver-maven-plugin ? the introduction of a specific goal that would fill the jgitver.
properties ?
As it looks to be a m2e issue what do you expect from jgitver-maven-plugin?
I would have expected that it sets the parameters always, but maybe it's the extension nature that makes m2e not invoke jgitver.
If I look at the m2e lifecycle mapping in Eclipse, I see that for example the compiler is an extension that is bound to a "configurator":
So it seems there is a way to bind extension goals to some lifecycle phase.
Since I don't exactly know how the internals of the extension mechanism works, I thought I'd leave this here.
the introduction of a specific goal that would fill the jgitver. properties ?
Yes, I think it could be helpful to have a jgitver goal that does this, preferably bound to the validate phase. At least it seems as I could explicitly request this to be executed in the pom.xml (see xml pasted in the issue description).
no https://maven.apache.org/plugins/maven-compiler-plugin is not an extension it is a plugin.
IDEs in general bypass the extensions because extensions have the power to dynamically change the initial POM (in memory Project Object Model). For example polyglot-maven build the POM from yaml/java/scala/json, jgitver modifies the version and introduces some plugins executions in the POM. For IDEs it is easier just to read the pom.xml file bypassing what the extensions are doing.
Exposing a plugin/goal filling the properties is I think the way to go here.
Issue
version: 1.7.1
usage context: Eclipse m2e
I have a file generated, using jgitver variables
where
templates/latest_release.xml
will look like this: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:When pressing "save" on any project, Eclipse m2e will to an incremental build and the file will be recreated as:
info/latest_release.xml
: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:
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.