Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] Request for advice

Hi Folks,

 

Hope you might be able to give us a few pointers. 

 

I’ve read as many resources as I could find before posting:-

 

https://docs.sonatype.org/display/M2ECLIPSE/Customizable+build+lifecycle+mapping+for+m2e+extensions+developers

https://docs.sonatype.org/display/M2ECLIPSE/Developer+Guide

https://docs.sonatype.org/display/M2ECLIPSE/ProjectConfigurator+contributor+guide

http://maven.apache.org/guides/mini/guide-generating-sources.html

 

But I am still at a bit of a loss as to the best high-level approach or in fact what is even possible with this combination of technologies.  If this is the wrong forum then please do point me in the right direction.  Or if there is more documentation that I haven’t read then again please just point me at it and I will go read it and come back if I have further questions.

 

In lieu of that though, I need to customize the lifecycle of the maven project that our eclipse/m2e-based builder tool creates.  At the end of the day it just creates a spring-based webapp but our builder is very heavily model-driven and we generate pretty much everything (services, UI, etc) from emf-based models.

 

Hence I need to hook something into the generate-sources and generate-resources phases of the project’s build lifecycle.  One point to note is that our many and varied code generators are already contributed into eclipse via a pre-existing extension point (from a previous incarnation that didn’t use m2e & maven to manage the project’s lifecycle).

 

So I was wondering what you guys thought was the best approach?  I can think of a few:-

 

#1 – standard maven approach; throw away the extensions and have those that want to contribute code generators write plain old mojos to do their specific code & resource gen – should work in IDE and for build team but my editor developers now need to know how to write mojos.

#2 – m2e approach; contribute some sort of m2e build participant (or a lifecycle mapping – not sure which) that executes in process and calls the extension-registered code generators at the appropriate point in the project’s build lifecycle – however I don’t see how this will work outside of eclipse for the build team – can it?

#3 – way out there approach; I contribute a generic mojo that calls back into eclipse, maybe via the OSGi http service, to a service that calls the extension-based code generators

 

Any others?

 

Thanks in advance

_Paul

 

 

 


Back to the top