revelc / formatter-m2e-configurator

M2E configurator for the formatter-maven-plugin
Apache License 2.0
7 stars 2 forks source link

Add to m2e discovery catalog #30

Open kwin opened 4 years ago

kwin commented 4 years ago

This m2e extension should be added to https://github.com/takari/m2e-discovery-catalog to be able to automatically install this once the formatter-maven-plugin is detected.

ctubbsii commented 4 years ago

This m2e extension should be added to https://github.com/takari/m2e-discovery-catalog to be able to automatically install this once the formatter-maven-plugin is detected.

I agree that it would be great to automatically discover and install this, but I don't know enough about this ecosystem to make it happen. Any chance you can help, @kwin ?

kwin commented 4 years ago

A prerequisite for this is a p2 update site from where the extension could be installed (https://github.com/revelc/formatter-m2e-configurator/issues/1). Once that is in place I can help creating a PR for the discovery catalog.

ctubbsii commented 4 years ago

@kwin Do you know if the Takari discovery catalog is the only way to get automatically discovered? Is there any way for the formatter plugin itself to define enough metadata for discovery on its own?

kwin commented 4 years ago

Is there any way for the formatter plugin itself to define enough metadata for discovery on its own?

This is not called discovery then, but sure you can integrate m2e support in the plugin as well: https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

ctubbsii commented 4 years ago

Is there any way for the formatter plugin itself to define enough metadata for discovery on its own?

This is not called discovery then, but sure you can integrate m2e support in the plugin as well: https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

I think we want to Delegate to a Project Configurator (recommended) on that page, but the link in that section for how to do that is broken. We have some metadata already defined in the formatter plugin, but I don't know the syntax. I assume that either:

  1. it defines only the configurator to delegate to, but not where to locate it, and you need to add the configurator to the discovery catalog for it to find it, or
  2. it can define the configurator to delegate to, and also the URL at which to find it.

Based on this conversation and my previous investigations into this, I think the first option is the only way this can work, but since the link is broken, I don't know where to look for the full syntax of the configurator in the metadata: https://github.com/revelc/formatter-maven-plugin/blob/main/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml#L26-L34