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

Support pom-model fragments in the pomless build #1976

Open
laeubi opened this issue Jan 13, 2023 · 3 comments
Open

Support pom-model fragments in the pomless build #1976

laeubi opened this issue Jan 13, 2023 · 3 comments

Comments

@laeubi
Copy link
Member

laeubi commented Jan 13, 2023

Currently tycho pomless is very powerful, but sometimes it is required to still configure things in the xml style (e.g. profiles).

It would therefore be good if one can deine a pom-model fragment that is then merged with the automatic generated one. If this works out well, we can even contribute this upstream to the polyglot project, this is a bit similar to https://github.com/repaint-io/maven-tiles but much more simpler.

@Frettman
Copy link

I've been looking for this as well. Right now it's all or nothing: Have it conveniently generated or write the complete POM yourself. When all you want to do is e.g. add a single plug-in to your module. And since the generated POM is deleted right after, you can't even use those as a starting template. Unless I'm missing something?

@laeubi
Copy link
Member Author

laeubi commented May 18, 2024

You have different options:

  1. define a plugin in the configurator pom and define a property (default to true) that skips the execution, then in your pomless module you can enable it with https://github.com/eclipse-tycho/tycho/wiki/Tycho-Pomless#define-properties this requires some support from the mojo but many have support for that.
  2. You can use a profile that is enabled when there is a special file present and configures the plugin, this is useful if you already have a file (e.g. for code generation) but of course also a dedicated one works

Beside that, you can let Tycho keep the generated pom.xml: https://github.com/eclipse-tycho/tycho/wiki/Tycho-Pomless#useful-tips

@Frettman
Copy link

Thank you, @laeubi, very useful information.
I needed to add some Maven plug-ins to all Eclipse plug-ins. As the common parent, I was looking to maybe merge those into the generated POM of my plugins aggregation folder. But a profile in my root POM with <activation><file><exists>plugin.xml</exists></file></activation> is actually even better.

Beside that, you can let Tycho keep the generated pom.xml: https://github.com/eclipse-tycho/tycho/wiki/Tycho-Pomless#useful-tips

I've been explicitly looking for this, but this little nugget has eluded me until now. Thank you :)

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

2 participants