cancel
Showing results for 
Search instead for 
Did you mean: 

Maven2 for building extensions

mindthegab
Champ in-the-making
Champ in-the-making
Hi all,
I'm working on a pretty big project of enterprise process reengineering in which the selected target platform is Alfresco.
As we'll be probably migrating lots of applications (>200) which will simply become Alfresco webclient extensions (or custom webclients build), and as we are going to define standards in project lifecycle management,
my belief is that using a tool such as maven2 would really help for a bunch of reasons:

- managing the complexity of this environment, storing the selected set of foundation libraries (dependencies) in an internal enterprise wide maven2 repository
- allowing to deploy project artifacts and resolve project interdependecies exploiting an enterprise wide repository, thus enabling/maximizing code reuse
- enforce standards in project management and in project structure by providing alfresco-related maven2 archetypes to allow a fast project startup
- standardize documentation process (maven2 sites), enforce Continuous Integration and so on…

I know that there's AMP but I believe that using and writing a lot of yet-another-ant-build won't certainly help in enforcing internal standard and best practices.
As I've already managed to successfully build an Alfresco based project with maven2 (and I was really amazed of the power and ease of doing it), I wanted to know if there will be any effort by the Alfresco community to support maven2 in the build process of Alfresco (not needed in my case as we will be using the Enterprise version) and in the build process of an Alfresco extension (really really easy, cause maven already overlays the Alfresco war with your extension codebase).

TIA,
Gabriele
8 REPLIES 8

mindthegab
Champ in-the-making
Champ in-the-making
BTW guys,
I'm moving on on the task and I also opened an Alfresco Forge project, in which we'll gather all our efforts:

http://forge.alfresco.com/projects/m2alfresco/

This means that sometime soon there will (hopefully) be archetypes for building Alfresco extensions.

Any help or feedback is kindly appreciated, of course Smiley Happy

rdanner
Champ in-the-making
Champ in-the-making
BTW guys,
I'm moving on on the task and I also opened an Alfresco Forge project, in which we'll gather all our efforts:

http://forge.alfresco.com/projects/m2alfresco/

This means that sometime soon there will (hopefully) be archetypes for building Alfresco extensions.

Any help or feedback is kindly appreciated, of course Smiley Happy

We recently moved all our builds to maven2 – it was horrible.  but now that it's done I'm glad we did it. 

If Alfresco had a Maven2 architype what would it be different than the standard library and web app architypes?  Do you think that architypes increase the barrier to entry by upping the learning curve?  My experience is that one of the drawbacks to maven is that it has a higher learning curve than ant. Also.. the eclipse plugin – less than great.  I appreciate the effort people are woking on it, but it really needs a lot of work.

jdbrown
Champ in-the-making
Champ in-the-making
Gabriele, I am currently experimenting with the M2Alfresco forge project for building enterprise extensions.  Ran into an error while trying to do a manual package for the local environment.  The error occurs while assembling the WAR.  It seems to expect that my Extension will have a web.xml file to overwrite the actual web.xml. In my case, I have no need to do that so do not have a web.xml file in the Extension itself.

I ran the command:  mvn clean package -e

Here is the error:
Error assembling WAR: Deployment descriptor: /apps/My-AlfrescoExt/target/alfresco/WEB-INF/web.xml does not exist.

[INFO] ————————————————————————
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error assembling WAR: Deployment descriptor: /apps/My-AlfrescoExt/target/alfresco/WEB-INF/web.xml does not exist.
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)

Maybe I am missing something simple?

jdbrown
Champ in-the-making
Champ in-the-making
Gabriele, I am currently experimenting with the M2Alfresco forge project for building enterprise extensions.  Ran into an error while trying to do a manual package for the local environment.  The error occurs while assembling the WAR.  It seems to expect that my Extension will have a web.xml file to overwrite the actual web.xml. In my case, I have no need to do that so do not have a web.xml file in the Extension itself.

I ran the command:  mvn clean package -e

Here is the error:
Error assembling WAR: Deployment descriptor: /apps/My-AlfrescoExt/target/alfresco/WEB-INF/web.xml does not exist.

[INFO] ————————————————————————
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error assembling WAR: Deployment descriptor: /apps/My-AlfrescoExt/target/alfresco/WEB-INF/web.xml does not exist.
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)

Maybe I am missing something simple?

Disregard - this was caused by an issue in how I packaged the enterprise repo.

mindthegab
Champ in-the-making
Champ in-the-making
We've releaed a full Alfresco application lifecycle management with maven…

See docs here:

http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven

mindthegab
Champ in-the-making
Champ in-the-making
Hey guys, things are moving on pretty fast on the Maven side, as we now have an Alfresco hosted Maven repository for Community artifacts and extensions at http://maven.alfresco.com/.

All the Maven Alfresco related activities are gathered in the Maven Alfresco Lifecycle project http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven.

mindthegab
Champ in-the-making
Champ in-the-making
Following yesterday's announcement of the official Alfresco Artifact Repository (http://blogs.alfresco.com/wp/its-offici … epository/),
marking this thread as solved as both Alfresco Community and Enterprise artifacts are hosted at http://artifacts.alfresco.com .

Please check:

https://wiki.alfresco.com/wiki/Alfresco_Artifacts_Repository
http://mindthegab.com/2012/06/05/introducing-the-alfresco-artifacts-repository-yes-with-alfresco-ent...

For a Maven ALfresco SDK please follow the evolution of the Maven Alfresco Lifecycle project at

http://code.google.com/p/maven-alfresco-archetypes/

by joining the dedicated ML at http://groups.google.com/group/maven-alfresco/.

fstnboy
Champ on-the-rise
Champ on-the-rise
Hi,

Can't find the WAR type dependency for Alfresco 3.4.9… for the rest of the versions seems to be there but for the one I need it's only POM… Any clues?