You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where templates/latest_release.xml will look like this:
<dependency>
<groupId>some.group.id</groupId>
<artifactId>some.artifact.id</artifactId>
<version>${jgitver.base_tag}</version> <!-- TEMPLATE HAS A VARIABLE -->
</dependency>
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:
<dependency>
<groupId>some.group.id</groupId>
<artifactId>some.artifact.id</artifactId>
<version>1.2.0</version> <!-- COPIED FILE HAS THE VARIABLE REPLACED -->
</dependency>
When pressing "save" on any project, Eclipse m2e will to an incremental build and the file will be recreated as: info/latest_release.xml:
<dependency>
<groupId>some.group.id</groupId>
<artifactId>some.artifact.id</artifactId>
<version>${jgitver.base_tag}</version> <!-- NO VARIABLE SET DURING INCREMENTAL BUILD (= revert substitution) -->
</dependency>
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.
The text was updated successfully, but these errors were encountered:
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).
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.
The text was updated successfully, but these errors were encountered: