I am experiencing the following issue when building with Tycho 0.23.1.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<shortRevisionLength>7</shortRevisionLength>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<timestampFormat>{0,date,yyyyMMddHHmm}</timestampFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>0.23.1</version>
<configuration>
<forceContextQualifier>v${timestamp}-${buildNumber}</forceContextQualifier>
<finalName>${project.artifactId}_${unqualifiedVersion}-${buildQualifier}</finalName>
</configuration>
</plugin>
When the build qualifier gets validated (resolution of
bug 464887[1] introduced this step) the value of
forceContextQualifier seems to have been not interpolated yet, so an exception is thrown and the build fails, as the output of
[DEBUG] Configuring mojo 'org.eclipse.tycho:tycho-packaging-plugin:0.23.1:build-qualifier' with basic configurator -->
[DEBUG] (f) baseDir = /home/enrico/projects/XXXX
[DEBUG] (f) execution = org.eclipse.tycho:tycho-packaging-plugin:0.23.1:build-qualifier {execution: default-build-qualifier}
[DEBUG] (f) forceContextQualifier = v${timestamp}-${buildNumber}
[DEBUG] (s) format = yyyyMMddHHmm
[DEBUG] (f) packaging = eclipse-plugin
[DEBUG] (f) project = MavenProject: XXXX
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@101a64
[DEBUG] -- end configuration --
[...]
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.23.1:build-qualifier (default-build-qualifier) on project XXXX: Invalid build qualifier, it does not match the OSGi qualifier constraint ([0..9]|[a..zA..Z]|'_'|'-')
-> [Help 1]
As I can see in the same log, the org.codehaus.mojo:buildnumber-maven-plugin:1.3:create goal is executed before org.eclipse.tycho:tycho-packaging-plugin:0.23.1:build-qualifier,
so I would expect that timestamp and
buildNumber properties have already been assigned a value when the latter performs its execution. Is this assumption correct?
Builds performed using Tycho 0.22.0 complete without errors, because at some point forceContextQualifier gets its value as expected, as also happens to finalName.
I've noticed that running the build with 0.22.0 actually displays the following:
[INFO] The project's OSGi version is 0.9.17.v${timestamp}-${buildNumber}
Why forceContextQualifier value does not benefit from interpolation in the validation phase?
Is there a way by which I could get the qualifier set in the POM using values of other properties?
Thanks for your attention,
regards
--