eclipse-lemminx / lemminx-maven

lemminx-maven
Eclipse Public License 2.0
38 stars 31 forks source link

Check that pom.xml and MANIFEST.MF have same version #165

Open akurtakov opened 4 years ago

akurtakov commented 4 years ago

It's tycho specific but it's not intrusive and will help everyone using Tycho. https://git.eclipse.org/c/platform/eclipse.platform.releng.git/tree/bundles/org.eclipse.releng.tools/src/org/eclipse/releng/internal/tools/pomversion/PomVersionErrorReporter.java has implementation that's purely eclipse specific.

mickaelistria commented 4 years ago

I think we can try to improve that deeper in tycho, by making the validate-version mojo m2e compatible so it would be run by default by m2e on build, and would report errors "naturally". However, that wouldn't work with other IDEs, but I don't think we have to care, do we?

akurtakov commented 4 years ago

I'm fine with Eclipse only. Only question is can we get quick fix that way too?

AObuchow commented 4 years ago

I'm fine with Eclipse only. Only question is can we get quick fix that way too?

It seems that code action's (quick fixes) can be contributed through LemMinX extensions.

Perhaps when a tycho build error is reported, it could populate the list of quick fixes, and if the build error from tycho reports an incorrect pom version, a quick fix could be contributed to fix this.

I haven't thought too much about the implementation details, but this seems possible.

mickaelistria commented 4 years ago

It requires more investigation, but for any marker in Eclipse IDE, it's possible to get a quickfix easily enough. The tricky part remains about making Maven show a marker for the Tycho validate-version mojo. Given that Tycho is a Maven extension (although this specific mojo may not need it), it might be tricky to get and a plain text approach in the LS may be more profitable in the end.

HannesWell commented 2 months ago

Wouldn't such Tycho and therefore also PDE specific feature be better placed in the o.e.m2e.pde.connector? https://github.com/eclipse-m2e/m2e-core/tree/master/org.eclipse.m2e.pde.connector

It already builds the bridge from the bnd-maven-plugin and Felix' maven-bundle-plugin and also handles Tycho plugins. Not sure if having support for Eclipse specific Maven-plugins has to be generalized in a LS, since I assume the vast majority of users of Tycho uses Eclipse.