Sculptor - M2 Plugins: Support for Eclipse M2E -> M2E Extension (Connector)

281 views
Skip to first unread message

Torsten Juergeleit

unread,
Aug 8, 2011, 8:45:35 AM8/8/11
to fornax-...@googlegroups.com
Is there anyone using Eclipse with the M2E plugin (Maven support) with Sculptor?
If yes, how are you're handling the execution of the Sculptor M2 plugins within M2E [2]?

Is anyone thinking about implementing an M2E connector for Sculptor to add support for the Sculptor M2 plugins [3]?
There're already plenty of OSS implementations of M2E connectors for code generators (Antlr, jaxb, javacc, ...) available, e.g. [4], [5].

Right now I can think of the following features for a simple M2E connector for Sculptor:

* provide <lifecylceMappingMetaData/> for turning off Sculptors M2 plugins within Eclipses incremental build
* add folders containing the generated code to Eclipses java build path

/Torsten

[1] http://www.eclipse.org/m2e/
[2] http://wiki.eclipse.org/M2E_plugin_execution_not_covered
[3] http://wiki.eclipse.org/M2E_Extension_Development
[4] http://objectledge.org/confluence/display/TOOLS/M2E+Connectors
[5] http://jibx.sourceforge.net/maven-jibx-plugin/m2e.html

Patrik Nordwall

unread,
Aug 11, 2011, 1:59:01 AM8/11/11
to fornax-...@googlegroups.com
Interesting. Contributions are welcome ;-)

Torsten Juergeleit

unread,
Aug 11, 2011, 5:46:54 PM8/11/11
to fornax-...@googlegroups.com
Ok, here we go.

Attached you can find a plugin jar (with the corresponding source jar) which implements the <lifecylceMappingMetaData/> to disable the Sculptor M2 plugins and adds the folders with generated artifacts to the Eclipse projects classpath.

/Torsten
org.fornax.cartridges.sculptur.m2e.connector_1.0.0.jar
org.fornax.cartridges.sculptur.m2e.connector.source_1.0.0.jar

Torsten Juergeleit

unread,
Aug 12, 2011, 7:51:05 AM8/12/11
to fornax-...@googlegroups.com
There's one feature missing in the Sculptor M2E Connector: Getting rid of the pesky "Java Build Path Excluded: **" on resource folders

I'll try to adopt the approach suggested in Eclipse Bug 351092 [1].

/Torsten

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=351092#c1



Am Donnerstag, 11. August 2011 23:46:54 UTC+2 schrieb Torsten Juergeleit:
Ok, here we go.

Attached you can find a plugin jar (with the corresponding source jar) which implements the <lifecylceMappingMetaData/> to disable the Sculptor M2 plugins and adds the folders with generated artifacts to the Eclipse projects classpath.

/Torsten

Am Donnerstag, 11. August 2011 07:59:01 UTC+2 schrieb Patrik Nordwall:
Interesting. Contributions are welcome ;-)

Patrik Nordwall

unread,
Aug 13, 2011, 2:22:29 AM8/13/11
to fornax-...@googlegroups.com
How do I install and activate the plugin for a project?
/Patrik

Torsten Juergeleit

unread,
Aug 13, 2011, 8:36:59 AM8/13/11
to fornax-...@googlegroups.com
>How do I install and activate the plugin for a project?

Copy the plugin into "<Eclipse inststallation>/plugins/" and restart Eclipse with the option "-clean" [1] (can be removed after restart) to pickup the new plugin in it's plugin folder.
You can check via "Help > About Eclipse > Installation Details > Plug-Ins > Plug-In Id" if the plugin is picked-up by Eclipse.

The plugin is automatically activated by M2E if M2E detects one of the Sculptor M2 plugins within a M2E-enabled Maven / Eclipse project.

The plugins makes sure (by the provided lifecylceMappingMetaData config} that the Sculptor M2 plugins are not triggered within Eclipses internal JDT builds.
Additionally the plugin adds the missing outlet folders of the OAW plugin to the Eclipse projects classpath. This is done when a Eclipse project is converted into a M2E Maven project or if the project context menu option "Maven > Update Project Configuration" is selected.  

/Torsten

Torsten Juergeleit

unread,
Aug 13, 2011, 3:09:33 PM8/13/11
to fornax-...@googlegroups.com
Attached you can find a new version of the plugin which removes the exclusion pattern "**" from the resources classpath entries.

I've renamed the plugin from "org.fornax.cartridges.sculptur.m2e.connector" to "org.fornax.toolsupport.m2e.connector". So you have to delete the old version from the "<Eclipse install>/plugins/" folder.

/Torsten


Am Freitag, 12. August 2011 13:51:05 UTC+2 schrieb Torsten Juergeleit:
There's one feature missing in the Sculptor M2E Connector: Getting rid of the pesky "Java Build Path Excluded: **" on resource folders

I'll try to adopt the approach suggested in Eclipse Bug 351092 [1].

/Torsten

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=351092#c1


Am Donnerstag, 11. August 2011 23:46:54 UTC+2 schrieb Torsten Juergeleit:
Ok, here we go.

Attached you can find a plugin jar (with the corresponding source jar) which implements the <lifecylceMappingMetaData/> to disable the Sculptor M2 plugins and adds the folders with generated artifacts to the Eclipse projects classpath.

/Torsten

Am Donnerstag, 11. August 2011 07:59:01 UTC+2 schrieb Patrik Nordwall:
Interesting. Contributions are welcome ;-)

org.fornax.toolsupport.m2e.connector_1.0.0.jar
org.fornax.toolsupport.m2e.connector.source_1.0.0.jar

Patrik Nordwall

unread,
Aug 14, 2011, 3:35:14 AM8/14/11
to fornax-...@googlegroups.com
I have added the source here. 

Please verify that it is correct. I changed typo sculptur -> sculptor.

There is some problem when I try to use it. I import a sculptor project as maven project. Then I get these errors in pom.xml
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.fornax.toolsupport:fornax-checksum-m2-plugin:1.0.0:run (execution: after generate, phase: generate-sources) pom.xml /m2test line 181 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: org.fornax.toolsupport:fornax-checksum-m2-plugin:1.0.0:run (execution: before generate, phase: initialize) pom.xml /m2test line 173 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: org.fornax.toolsupport:fornax-graphviz-m2-plugin:1.0.0:run (execution: default, phase: generate-resources) pom.xml /m2test line 196 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: org.fornax.toolsupport:fornax-oaw-m2-plugin:3.2.3:run-workflow (execution: default, phase: generate-sources) pom.xml /m2test line 155 Maven Project Build Lifecycle Mapping Problem

/Patrik

Torsten Juergeleit

unread,
Aug 14, 2011, 11:35:28 AM8/14/11
to fornax-...@googlegroups.com
These errors are indicating that the plugin isn't picked up by Eclipse or that the plugin is invalid. With a correctly initialized plugin these errors are gone because this plugin provides the missing lifecycle configurations for the Fornax M2 plugins.


>Please verify that it is correct.

Hhm, the source code is incomplete (missing plugin.xml, wrong bundle manifest which was "best guessed" by PDE) and outdated (I've posted a new version with a more appropriate package name -> "toolsupport" instead of "cartridges.sculptor" -> this plugin is not specific to Sculptor but the Fornax M2 plugins).


To get the complete source code of an Eclipse plugin (with its source code from the corresponding source bundle) within a running Eclipse you can use Eclipse PDEs import feature "File > Import > Import Plug-Ins and Fragments" with the options "The active target platform", "Select from all plug-ins..." and "Projects with source folders". This import merges the content of both jar files (the plugins binaries and the plugins sources) into a new (and complete) Eclipse plugin source project. This project you can commit to the SVN repository. Otherwise you'll end up with an incomplete project with an invalid bundle manifest generated by PDE.

From this Eclipse plugin project you can generate the plugins jars by using "File > Export > Deployable plug-Ins and fragments" with the options "Export source: Generate source bundle", "Package Plug-Ins as individual Jars", "Allow for binary cycles..." within a directory (here is a new directory "plugins" with both jars created).

/Torsten

jason...@gmail.com

unread,
Aug 14, 2011, 8:44:11 PM8/14/11
to fornax-...@googlegroups.com

Why not use the ignore action rather than noop configurator?


>>>>
>>>>
>>>> Am Donnerstag, 11. August 2011 23:46:54 UTC+2 schrieb Torsten Juergeleit:
>>>>
>>>>> Ok, here we go.
>>>>>
>>>>> Attached you can find a plugin jar (with the corresponding source jar)
>>>>> which implements the <lifecylceMappingMetaData/**> to disable the
>>>>> Sculptor M2 plugins and adds the folders with generated artifacts to the
>>>>> Eclipse projects classpath.
>>>>>
>>>>> /Torsten
>>>>>
>>>>> Am Donnerstag, 11. August 2011 07:59:01 UTC+2 schrieb Patrik Nordwall:
>>>>>
>>>>>> Interesting. Contributions are welcome ;-)
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 8, 2011 at 2:45 PM, Torsten Juergeleit <tor...@gmail.com>wrote:
>>>>>>
>>>>>>> Is there anyone using Eclipse with the M2E plugin (Maven support) with
>>>>>>> Sculptor?
>>>>>>> If yes, how are you're handling the execution of the Sculptor M2
>>>>>>> plugins within M2E [2]?
>>>>>>>
>>>>>>> Is anyone thinking about implementing an M2E connector for Sculptor to
>>>>>>> add support for the Sculptor M2 plugins [3]?
>>>>>>> There're already plenty of OSS implementations of M2E connectors for
>>>>>>> code generators (Antlr, jaxb, javacc, ...) available, e.g. [4], [5].
>>>>>>>
>>>>>>> Right now I can think of the following features for a simple M2E
>>>>>>> connector for Sculptor:
>>>>>>>
>>>>>>> * provide <lifecylceMappingMetaData/> for turning off Sculptors M2
>>>>>>> plugins within Eclipses incremental build
>>>>>>> * add folders containing the generated code to Eclipses java build
>>>>>>> path
>>>>>>>
>>>>>>> /Torsten
>>>>>>>
>>>>>>> [1] http://www.eclipse.org/m2e/

Torsten Juergeleit

unread,
Aug 15, 2011, 5:48:05 AM8/15/11
to fornax-...@googlegroups.com
Jason, you're right. Thanks.

Attached you can find an updated version of the plugin (and its source bundle) with NoOpProjectConfigurator replaced by <ignore/>.

/Torsten
org.fornax.toolsupport.m2e.connector_1.0.0.jar
org.fornax.toolsupport.m2e.connector.source_1.0.0.jar

Patrik Nordwall

unread,
Aug 15, 2011, 3:16:14 PM8/15/11
to fornax-...@googlegroups.com
I tried these latest jars and everything works like a charm. Great job!

Additional benefit of using this is that you can assign keyboard shortcut to mvn generate-sources. :-)

I removed the wrong source and you can add the correct once you got permissions to svn.

/Patrik

Torsten Juergeleit

unread,
Aug 16, 2011, 5:32:27 AM8/16/11
to fornax-...@googlegroups.com
>I tried these latest jars and everything works like a charm. Great job!

I'm glad that the plugin is working. Thanks.


One hint regarding the activation of the connector plugin:

The Fornax M2E connector Eclipse plugin is activated for a project only if the Fornax Maven plugins (mainly the OAW Workflow plugin) are NOT already deactivated via the M2E Maven plugin "org.eclipse.m2e.lifecycle-mapping" in the POM as shown in [1].

/Torsten

[1] http://wiki.eclipse.org/M2E_plugin_execution_not_covered#ignore_plugin_goal



Am Montag, 15. August 2011 21:16:14 UTC+2 schrieb Patrik Nordwall:
I tried these latest jars and everything works like a charm. Great job!

Additional benefit of using this is that you can assign keyboard shortcut to mvn generate-sources. :-)

I removed the wrong source and you can add the correct once you got permissions to svn.

/Patrik

On Mon, Aug 15, 2011 at 11:48 AM, Torsten Juergeleit <torsten.j...@gmail.com> wrote:
Jason, you're right. Thanks.

Attached you can find an updated version of the plugin (and its source bundle) with NoOpProjectConfigurator replaced by <ignore/>.

/Torsten


Am Montag, 15. August 2011 02:44:11 UTC+2 schrieb Jason Pell:

Why not use the ignore action rather than noop configurator?

Patrik Nordwall

unread,
Aug 21, 2011, 4:21:15 AM8/21/11
to fornax-...@googlegroups.com
I have deployed it to the update site:

I also deployed latest sculptor dsl plugins, 2.1.0.0

Thanks for a great contribution.

/Patrik

On Thu, Aug 18, 2011 at 7:46 AM, Patrik Nordwall <patrik....@gmail.com> wrote:
Perfect, I will look at it tonight.


On Wed, Aug 17, 2011 at 8:57 AM, Torsten Juergeleit <torsten.j...@gmail.com> wrote:
Here we go...

I've commited the source code of the plugin and the corresponding feature [1].

A compiled version of these and an update site.xml (not commited to the Sculptor update site project yet) can be find in the attached archive.
Maybe you can upload it to the web site.

/Torsten

Torsten Juergeleit

unread,
Aug 21, 2011, 6:05:51 PM8/21/11
to fornax-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages