Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic packaging not working properly #3714

Open
david-ecc opened this issue Mar 28, 2024 · 2 comments
Open

dynamic packaging not working properly #3714

david-ecc opened this issue Mar 28, 2024 · 2 comments

Comments

@david-ecc
Copy link

The tycho-versions:set-version Mojo does not change MANIFEST.MF when executed in a project with pom.xml and <packaging/> is set by property.

not working

Running mvn tycho-versions:set-version -DnewVersion=1.2.5.qualifier with this pom.xml changes only <version/> in pom.xml, MANIFEST.MF is not updated:

<project>
	<modelVersion>4.0.0</modelVersion>

	<groupId>tychotest</groupId>
	<artifactId>dynamicpackaging</artifactId>
	<packaging>${packaging}</packaging>
	<version>1.0.0-SNAPSHOT</version>
	<properties>
		<packaging>eclipse-plugin</packaging>
		<tycho-version>4.0.7</tycho-version>
	</properties>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-versions-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
		</plugins>
	</build>
</project>

Output:

[INFO] Scanning for projects...
[INFO] Tycho Version:  4.0.7 (0dbf79b2a18b352cdfa8ea65f7d433e0ff838100)
[INFO] Tycho Mode:     project
[INFO] Tycho Builder:  maven
[INFO] Build Threads:  1
[INFO]
[INFO] ---------------------< tychotest:dynamicpackaging >---------------------
[INFO] Building dynamicpackaging 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------[ eclipse-plugin ]---------------------------
[INFO]
[INFO] --- tycho-versions:4.0.7:set-version (default-cli) @ dynamicpackaging ---
[INFO] Making changes in C:\dev\workspace-efile-e4\dynamicpackaging
[INFO]   pom.xml//project/version: 1.0.0-SNAPSHOT => 1.2.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.518 s
[INFO] Finished at: 2024-03-28T13:00:49+01:00
[INFO] ------------------------------------------------------------------------

working

If packaging is set without properties mvn tycho-versions:set-version -DnewVersion=1.2.5.qualifier modifies both pom.xml AND MANIFEST.MF.

<project>
	<modelVersion>4.0.0</modelVersion>

	<groupId>tychotest</groupId>
	<artifactId>dynamicpackaging</artifactId>
	<packaging>eclipse-plugin</packaging>
	<version>1.0.0-SNAPSHOT</version>
	<properties>
		<tycho-version>4.0.7</tycho-version>
	</properties>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-versions-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
		</plugins>
	</build>
</project>

Output:

[INFO] Scanning for projects...
[INFO] Tycho Version:  4.0.7 (0dbf79b2a18b352cdfa8ea65f7d433e0ff838100)
[INFO] Tycho Mode:     project
[INFO] Tycho Builder:  maven
[INFO] Build Threads:  1
[INFO]
[INFO] ---------------------< tychotest:dynamicpackaging >---------------------
[INFO] Building dynamicpackaging 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------[ eclipse-plugin ]---------------------------
[INFO]
[INFO] --- tycho-versions:4.0.7:set-version (default-cli) @ dynamicpackaging ---
[INFO] Making changes in C:\dev\workspace-efile-e4\dynamicpackaging
[INFO]   META-INF/MANIFEST.MF//Bundle-Version: 1.0.0.qualifier => 1.2.5.qualifier
[INFO]   pom.xml//project/version: 1.0.0-SNAPSHOT => 1.2.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.501 s
[INFO] Finished at: 2024-03-28T12:58:52+01:00
[INFO] ------------------------------------------------------------------------
@laeubi
Copy link
Member

laeubi commented Mar 28, 2024

@david-ecc I'm not sure having packaging be a property is actually supported, anyways we have some test cases here:

https://github.com/eclipse-tycho/tycho/tree/main/tycho-its/projects/tycho-version-plugin

Do you like to provide an integration-test to demonstrate the issue and maybe even propose a fix?

@cstamas
Copy link

cstamas commented Mar 28, 2024

Is this "dynamic packaging" maybe related to some IDE hack/workaround? Or what is the purpose of having it "dynamic"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants