| Summary: | Provide a maven integration plugin | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Acceleo | Reporter: | Mariot Chauvin <mariot.chauvin> | ||||||
| Component: | Core | Assignee: | Project Inbox <acceleo-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | cmordant1, ivalo, ptitjes, sbouchet, stephane.begaudeau | ||||||
| Version: | 3.0.0 | Flags: | mariot.chauvin:
indigo+
|
||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | maven | ||||||||
| Bug Depends on: | 340740 | ||||||||
| Bug Blocks: | 365557 | ||||||||
| Attachments: |
|
||||||||
|
Description
Mariot Chauvin
Starting with Acceleo 3.1M7 we will now have a pom.xml file that will be automatically created to launch the compilation. A maven archetype for Acceleo is also available on the Acceleo CVS repository. Project created with this archetype will use Tycho as Acceleo bundles are not available on the maven repository of the Eclipse foundation yet. Hi, I've got the M7 plugin from the nightlies repo. When I create a New Acceleo project, I don't see any pom, just an Ant task with eclipse installation linked resource (not so good for continuous build integration). What's the status of this enhancement? In Acceleo 3.1.0 RC1, which will be released tomorrow, an action is available to create the pom.xml (right click -> Acceleo -> Generate pom.xml). A similar action will be available to create an Ant file for the headless compilation. The pom.xml was automatically created before but some of our user may have no interest in maven so we won't create it automatically now. The pom.xml is directly inspired from the Acceleo Maven archetype (available right now only on the CVS repository of Acceleo: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.m2t/org.eclipse.acceleo/maven/?root=Modeling_Project). This pom.xml will use Tycho to create an Eclipse bundle. The action (that I am improving this morning) will generate the pom.xml and a Java class to let the user customize some options of the headless compilation (register additional packages or other resource factories for example). (In reply to comment #3) > This pom.xml will use Tycho to create an Eclipse bundle. The action (that I am > improving this morning) will generate the pom.xml and a Java class to let the > user customize some options of the headless compilation (register additional > packages or other resource factories for example). I might be wrong but it seems to me that this ties an Acceleo generator to be an eclipse plugin. In our project, we need to build our Acceleo generator to produce a pure Java/EMF generator library. That generator will then be called as part of a maven plugin. I guess this should not be a problem as the Acceleo compiler can run outside Eclipse and the produced java code can be ran outside Eclipse, right ? Will you cover that use case ? (In reply to comment #4) > (In reply to comment #3) > > This pom.xml will use Tycho to create an Eclipse bundle. The action (that I am > > improving this morning) will generate the pom.xml and a Java class to let the > > user customize some options of the headless compilation (register additional > > packages or other resource factories for example). > > I might be wrong but it seems to me that this ties an Acceleo generator to be > an eclipse plugin. > > In our project, we need to build our Acceleo generator to produce a pure > Java/EMF generator library. That generator will then be called as part of a > maven plugin. > > I guess this should not be a problem as the Acceleo compiler can run outside > Eclipse and the produced java code can be ran outside Eclipse, right ? > > Will you cover that use case ? We will cover that use case but we will need the jars of the Acceleo project on a maven repository first. The Eclipse Foundation is currently working on making all the jars of all the Eclipse projects on a maven repository. http://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg06324.html I have implemented Maven 3 plugin (with 2 mojo's) to compile templates and generate text. I can contribute that code. (In reply to comment #6) > I have implemented Maven 3 plugin (with 2 mojo's) to compile templates and > generate text. I can contribute that code. Hi Marku, That will be an awesome contribution, so feel free to provide the code here on this bugzilla as an attachement. Cheers How to proceed? It is part of my Sourceforge project with Apache 2 license headers in files. I can change license. Of course there is pain of installing Acceleo dependencies that are not available in some Maven repository yet(simple script can do that until all required dependencies are in ex Maven Central). Hi all, We also have a working plugin since July. We intended to give that to Acceleo project and I completely forgot to add the info in this ticket :p I deliberately used org.eclipse.acceleo.maven package name. But I did not yet put any Licence files nor headers. You can use that as your own and incorporate it in Acceleo if the project pleases you. Just tell me where I can get the official version when it is incorporated. https://github.com/ptitjes/maven-acceleo-compiler-plugin This is a maven project that builds a maven plugin to build some acceleo templates. It needs some dependencies from the Eclipse workspace. So to export your dependencies to the local maven repository you can use that project: https://github.com/ptitjes/tools-bundle2maven That tool is a command-line tool that takes the path to your Eclipse plugin directory and a list of the maven dependency names (for instance: "org.eclipse.acceleo:org.eclipse.acceleo.engine"). Be careful that it uses java's Process class so it may not work correctly on some Windows. Enjoy. Comments are welcome. >>> But I did not yet put any Licence files nor headers. The Eclipse Foundation uses mostly the Eclipse Public Licence: http://en.wikipedia.org/wiki/Eclipse_Public_License You may use something else but some open source licence like the GPL for example are not compatible with the EPL (the GPL would require Acceleo and Eclipse to be under the GPL). Thus EPL is the easiest solution for a piece of open source code that should be integrated in an Eclipse project. Created attachment 201604 [details]
Maven 3 Acceleo plugin contribution for compiling templates and generating text.
Now licence headers changed from Apache to EPL.
Attachment Maven 3 plugin for compiling templates and generating text.
Install Acceleo Eclipse dependencies in pom.xml in you local Maven repository or better upload them into some Maven Repository Management implementation. Hopefully sometime all dependencies are available in some Maven global repository.
Run mvn install site in order to get plugin available in you local environment and to get plugin site documentation generated. In this generated site is preliminary documentation for configurations.
Created attachment 201606 [details]
Acceleo template project example for Acceleo Maven plugin
This example how to compile templates and install as Maven dependency to use in generator project. This should be part of plugin project site generation.
Feel free to ask help or examples.
(In reply to comment #10) > The Eclipse Foundation uses mostly the Eclipse Public Licence: > http://en.wikipedia.org/wiki/Eclipse_Public_License We don't mind at all what license you put as the plugin will be downloaded as part of our build process. So it seems logical to use EPL. I'm sorry but I will not have any time to work on a possible comparison/integration with Markku Saarela's work. Maybe someone from the Acceleo project can look at it ? (In reply to comment #11) > Created attachment 201604 [details] > Maven 3 Acceleo plugin contribution for compiling templates and generating > text. > > Now licence headers changed from Apache to EPL. > Attachment Maven 3 plugin for compiling templates and generating text. > > Install Acceleo Eclipse dependencies in pom.xml in you local Maven repository > or better upload them into some Maven Repository Management implementation. > Hopefully sometime all dependencies are available in some Maven global > repository. > Run mvn install site in order to get plugin available in you local environment > and to get plugin site documentation generated. In this generated site is > preliminary documentation for configurations. Thanks Markku ! To integrate this we need that you confirm in a comment about the attached files that : - You wrote 100% of the code - You have the right to contribute the code to Eclipse (In reply to comment #13) > (In reply to comment #10) > > The Eclipse Foundation uses mostly the Eclipse Public Licence: > > http://en.wikipedia.org/wiki/Eclipse_Public_License > > We don't mind at all what license you put as the plugin will be downloaded as > part of our build process. So it seems logical to use EPL. > To integrate your code, we are mandatory to follow the Eclipse IP Process. So we need that you follow the following steps : - Attach your code to this bugzilla with for each file a header which contains the EPL declaration (See http://www.eclipse.org/legal/copyrightandlicensenotice.php for a template) - Confirm in a comment that you wrote 100% of the code and hat you have the right to contribute the code to Eclipse You may find reference of this duties in the Eclipse IP Process Poster : http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf Thanks for your comprehension, we understand that it could be unwieldy. > I'm sorry but I will not have any time to work on a possible > comparison/integration with Markku Saarela's work. Maybe someone from the > Acceleo project can look at it ? Yes we will have a look to both implementation and compare them. We will probably mix them to have a great implementation integrated in Acceleo :) Anyway thanks for your contribution. I have wrote all the code of my contributionand so I have all rights to contribute my code to Eclipse foundation. I have wrote all the code of my contributions in attachments Maven 3 Acceleo plugin contribution for compiling templates and generating text. (https://bugs.eclipse.org/bugs/attachment.cgi?id=201604) and Acceleo template project example for Acceleo Maven plugin (https://bugs.eclipse.org/bugs/attachment.cgi?id=201606) So I have all rights to contribute my code to the Eclipse foundation. Markku Saarela I am happy to contribute more code or documentation (at least site documentation from my contribution is not completed yet) of this Maven integration plugin, what ever mixed implementation you decide to publish( mine combined with Didier Villevalois contribution). Only thing what matters is that end users are happy of the implementation and usage(i can use that:-)). More news on the maven integration plugin: http://sbegaudeau.tumblr.com/post/16059815253/maven-integration-in-acceleo A first version of the new maven integration plugin is available. It will be officially released with the Juno release (in two / three weeks). The documentation is available on the Eclipse wiki: http://wiki.eclipse.org/Acceleo/Maven A test project for the stand alone build is available: http://git.eclipse.org/c/m2t/org.eclipse.acceleo.git/tree/tests/org.eclipse.acceleo.maven.tests Along with a test project for a tycho based build: http://git.eclipse.org/c/m2t/org.eclipse.acceleo.git/tree/tests/org.eclipse.acceleo.maven.plugin.tests The lifecycle of this maven plugin is separated from the Acceleo project lifecycle and as such new improvements may arrive without having to wait for a new official release of Acceleo. Feel free to re-open this issue if you find a bug or if you want a new feature in this maven plugin. Closing resolved bugs |