Community
Participate
Working Groups
Build Identifier: 0.13.0 Using the buildQualifier argument, -DbuildQualifier=M01 for example, I found out that, even for bundles already specifying a full version without qualifier, they see their qualifiers updated with the buildQualifier. Here is the example I attached to demonstrate this case : * build this example with mvn clean install : you'll see in target/MANIFEST.MF Bundle-Version: 1.0.0 and the jar will be named target/tycho.qualifier.example-1.0.0.jar * now build this example with mvn clean install -DbuildQualifier=M01 : you'll see in target/MANIFEST.MF Bundle-Version: 1.0.0.M01 and the jar will still be named target/tycho.qualifier.example-1.0.0.jar The problem occurs when you have a reactor with projects having a qualifier, and some not having a qualifier : I expect that if I set a buildQualifier, only the projects having a qualifier would be impacted not the others (and also there is an inconsistency between the manifest version and the jar name in this case) The code that seems to update the Bundle-Version is : DefaultReactorProject.setExpandedVersion I only tried with tycho 0.13.0 Reproducible: Always Steps to Reproduce: 1. build this example with mvn clean install : you'll see in target/MANIFEST.MF Bundle-Version: 1.0.0 and the jar will be named target/tycho.qualifier.example-1.0.0.jar 2. now build this example with mvn clean install -DbuildQualifier=M01 : you'll see in target/MANIFEST.MF Bundle-Version: 1.0.0.M01 and the jar will still be named target/tycho.qualifier.example-1.0.0.jar
Created attachment 207934 [details] the simple example to demonstrate the bug
just a thought about the resolution : I think that if we add : if (version.getQualifier() != null && !version.getQualifier().equals("qualifier")) { project.setContextValue(TychoConstants.CTX_EXPANDED_VERSION, version); return; } to https://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultReactorProject.java#n169 that should fix it. (ok ok, the "qualifier" string should be shared; it is already the case... in org.eclipse.tycho.buildversion.VersioningHelper that depends on ... tycho-core :-( ) what do you think ?
I think I'll be happy to review&apply a patch that includes the fix and corresponding unit/integration tests ;-)
Created attachment 208015 [details] Patch providing both the fix and the associated it test This provided patch fixes the bug. I don't think it creates any regression (some it tests never run on my machine...) I hope reviewing this patch will make you happy ;-) Have a good day !
Wow ! seems like I got a total misunderstanding of the build qualifier... the env. variable "buildQualifier" is only used internally and should not be used when launching maven. instead, using the build qualifier goal of the tycho-packaging-plugin takes care of everything. with this snippet in the parent : <plugin> <!-- Generates the build qualifier and expose a property named 'buildQualifier' --> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-packaging-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <id>build-qualifier</id> <goals> <goal>build-qualifier</goal> </goals> <phase>validate</phase> <configuration> <format>${build.qualifier}</format> </configuration> </execution> <execution> <id>packaging</id> <configuration> <archive> <addMavenDescriptor>false</addMavenDescriptor> </archive> </configuration> </execution> </executions> </plugin> a -Dbuild.qualifier=M01 will put M01 as a qualifier and will not update the fixed versions. I'd like to document this somewhere so that other users may know; can I create a wiki page for that ? (TychoAndBuildQualifier page in tycho wiki)
(In reply to comment #5) > > I'd like to document this somewhere so that other users may know; can I create > a wiki page for that ? (TychoAndBuildQualifier page in tycho wiki) Yes, by all means document this, wiki.eclipse.org is open for everybody.
I added a note to http://wiki.eclipse.org/Tycho/FAQ Marking this as RESOLVED WONTFIX.
Thanks Brian, I forgot to document, will do better next time ;-)