Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Run plugins before Maven-Tycho build #433

Closed
LuluDavid opened this issue Dec 14, 2021 · 1 comment
Closed

Run plugins before Maven-Tycho build #433

LuluDavid opened this issue Dec 14, 2021 · 1 comment
Milestone

Comments

@LuluDavid
Copy link

Hi, I am creating an issue because I am working currently with maven-tycho-plugin for a bunch of OSGI bundles, and I have a small problem to include preliminary instructions in my maven build before tycho's dependency resolution.
The problem is :

  • Tycho (or potentially plexus) ties its resolution to the validate phase (as described in this file, which is the first executed phase
  • I am packaging my bundles as eclipse-plugin (so the resolution is done for all of them)
  • All further plugins executions tied to the validate phase are executed afterwards (in accordance to Maven's lifecycle description)

So in my case, as I want to download a jar that is referenced locally in one of my bundle's classpath before Tycho's dependency resolution, it does not work for the first build (but works for the second one as the jar is available then).

I found this issue that references a similar problem, but the concerned pom is packaged as pom and I tried overriding tycho-maven-plugin's executions to tie all validate-related ids (org.eclipse.tycho:tycho-packaging-plugin:${project.version}:build-qualifier,org.eclipse.tycho:tycho-packaging-plugin:${project.version}:validate-id, org.eclipse.tycho:tycho-packaging-plugin:${project.version}:validate-version) to the initialize phase instead :

<pluginManagement>
      ...
      <plugin>
	      <groupId>org.eclipse.tycho</groupId>
	      <artifactId>tycho-maven-plugin</artifactId>
	      <version>${tycho.version}</version>
	      <extensions>true</extensions>
	      <executions>
		      <execution>
			      <id>org.eclipse.tycho:tycho-packaging-plugin:${project.version}:build-qualifier</id>
			      <phase>initialize</phase>
		      </execution>
		      <execution>
			      <id>org.eclipse.tycho:tycho-packaging-plugin:${project.version}:validate-id</id>
			      <phase>initialize</phase>
		      </execution>
		      <execution>
			      <id>org.eclipse.tycho:tycho-packaging-plugin:${project.version}:validate-version</id>
			      <phase>initialize</phase>
		      </execution>
	      </executions>
      </plugin>
</pluginManagement>

Without further success.

If you have any insight or idea to solve this issue, or if my question is not relevant, feel free to answer.
Thanks for reading !

@laeubi
Copy link
Member

laeubi commented Dec 14, 2021

Tycho actually runs as an extension outside the regular life-cycle.

in my case, as I want to download a jar that is referenced locally in one of my bundle's classpath

classpath resolution should take place in the compile phase, so maybe you can explain a bit more about your "download" and why there is no other way to provide it to your build (e.g. as a maven dependency).
Theoretically it should work to have an (empty) default file in the repo that is later on overwritten ...

@eclipse-tycho eclipse-tycho locked and limited conversation to collaborators Dec 14, 2021
@laeubi laeubi converted this issue into discussion #434 Dec 14, 2021
@laeubi laeubi added this to the 2.6 milestone Jan 4, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants