Feb 23

Two months without a post, and I come back again with Maven and Alfresco? Well, no news as the Maven Alfresco Community keeps growing..

So following the exciting news on Spring Surf and Share announced by Kev on trunk, for which since Alfresco 3.3 (now in trunk) we can now build Alfresco Share Extensions as plain old JARs, I decided to complete the Maven Alfresco Lifecycle with another archetype, providing a simple way and sample code allowing to build Maven2 Alfresco Share Extensions in minutes.

I’m sure this is going to interest the Alfresco community, same as it’s Ant counterpart build script which Will’s recently produced to accomplish the same task. The more, the merrier isn’t it? The big difference between that approach and the one we’re presenting is only that Maven enforce a standard project layout so it was fairly easy to put stuff to be packaged in the proper place.

This also comes as a very natural complement to the Maven Alfresco Share Extension Archetype (managing WAR customized builds for Share) for now it’s possible to build a Share WAR and have it depend on Share JAR modules. Great kudos go to colleague and mate Will Abson and Alfresco Engineers for having produced and nurtured the Site Tags Dashlet which is included in this archetype and that you can install following the next steps in a couple of minutes.

Couple of pre-requisites for running this:

  • Alfresco Repository WAR 3.3 (TRUNK) already running on Tomcat. You can build this from trunk and run it in your tomcat instance, or find it deployed in the Maven Alfresco Community Repository
  • Tomcat Manager already installed and using credentials “admin” with no password (config in conf/tomcat-users.xml)
  •  (optionally) m2Eclipse eclipse plugin to import Maven project (not needed but cool :) )

Ready, set, go: Continue reading »

Dec 04

As promised, just a brief heads up on the quite few changes ongoing in the Maven Alfresco Lifecycle project which is now supported by the Alfresco Community Maven repository.  Also I managed to pull out a new version of the Cmis Maven toolkit against the new repository.

Proceeding with order, first of all, I released today a new version (1.1.0) of the maven-alfresco-lifecycle package with the main interesting news (full changes report):

The long Maven Alfresco marathon was then completed by the release of version 1.0-beta-2 of the CMIS 1.0cd04 Maven Toolkit, pointing to the new Maven repository. No actual functionality was modified and it keeps on working happily (by default against http://cmis.alfresco.com) using the latest snapshots from the Chemistry AtomPub TCK trunk. I updated the documentation on the Alfresco wiki as well.

I hope this really helps as it’s just *not that* funny to go over those growing many documentation files to change repos again, so any edit or error you guys can spot in the docs === a beer on me when you seem me :)

Though I first have to apologize to the end users of this build, promising this is the last time this project moves hosting.
Now everything is consolidated, content as artifacts, as in the pure ECM spirit. And with a promising Share archetype to work and customize it productively.

Eager to hear your feedback (curious about the Share archetype), and especially at my Tech Talk on Maven and Alfresco

…don’t be shy :)

Dec 02

Busy days busy days, busy but definitely happy days ;)

after working a lot on the CMIS 1.0 Webinar (recording out soon) and having made my first official commit for Apache, I saw an unexpected but never so welcome outstanding speedup of one of the processes that I’ve been pushing in the Alfresco Community for about 3 years now.

I’m proudly announcing the institution of an Alfresco hosted Maven Repository, capable of consolidating and bring the Maven Alfresco Community to the next level. Hosting a repository (for Community artifacts only for now) means a great step towards a even more mature open source community which works against high standards of quality and automation.

I’ll be discussing and demoing this and other Maven Alfresco related topics in next Friday’s Alfresco Tech Talk Live. You’ll find more info on the Alfresco wiki.

For now, here’s a screenshot of our new shiny Sonatype Nexus 1.4.0 instance, which will allow a proper consolidation still scale-out for our community by the means of repositories proxying and Alfresco Community artifacts hosting. Kudos to everyone that made this happen :)

Alfresco Maven Repository

This is is a big step for the community which is growing around projects like the Maven Alfresco Lifecycle  and the small CMIS 1.0 Maven toolkit which I built for my recent training engagements.

In addition to that,  the mighty great news about the Alfresco SURF and Alfresco Webscripts project now being contributed to the Spring Framework under the newly born Spring Surf Extension (follow our work here), all of which is powered by Maven gives even a more central role to this technology in the company I work for.  Great job guys and thanks for giving me the opportunity to participate in this!

This is such a nice moment for me which I pushed for this since a long time, when I was still working for Sourcesense. And a special thanks must go to them for having first allowed me to work on a Maven Alfresco suite in the past and for having supported it with their Nexus instance, until we introduced an Alfresco Maven repo. Most content is now migrated so you can safely use the new repo in your POMs.

I’m still in the process of migrating (tomorrow should be done) all the apps to the new repo, so expect changes in the docs. I’ll keep you posted with the coming changes and news.

Also, please provide your feedback on this event so we can offer the best service around this important open source Application Lifecycle Management technology.

Nov 07

Few Build Successful’s were more satifsactory then the one which you can see in the window below ;)

Maven Alfresco Lifecycle build successful

Finally all the modules that I’ve been working together with the community, including AMP & Alfresco Extension Maven archetypes and the AMP plugin, under one single build, control and with a proper release process, called (almost obviously) Maven Alfresco Lifecycle featuring:

It was time to wrap up all this work (merging m2Alfresco, maven4Alfresco and other Maven Alfresco related activities) in a more usable and sustainable platform for growing it.

As usual, many thanks go to Mao that provided 1st class infrastructure support (and much more :) on the new Nexus Sourcesense repository.

And this being a double advantage, not only for the community but for the growing number of enterprise customers interested in working with Maven on Alfresco.
I would like now to grow it with features already present in some development branches and exciting new improvements like:

  • Alfresco Share archetype support (already in 3.x branches)
  • SURF / Spring tool suite integration (as Uzi shown us so to be so cool with the new spring-surf)
  • Update and improve the quality of the sample contexts to match the latest and greatest capabilities

As said, I see the interest of the community at large around the project is growing so in case you’re interested I suggest you to participate by joining the lists or opening issues.

So just give it a try…it’s two Maven commands away ;)

Would love to hear your thoughts on how to improve the platform and grow it to the next (enterprise) level. Don’t forget to check out the 3.1.0-stripped branch, where a Maven Calm based version is hosted and there’s already a working Alfresco Share sample project.

Have fun!

Oct 19

CMIS is cool indeed, and especially working on it with Open Source tools like Alfresco, Maven and Chemistry can result in quite a bit of fun.

I’ve been working quite a lot lately on producing some sample and training material for the coming Alfresco meetups (tomorrow I’ll be presenting the CMIS Master class  live from Madrid), and so I decided to mix and match the two things I can do best:

  • Using my beloved Apache Maven
  • Using the Chemistry AtomPub TCK (former Alfresco CMIS TCK) that we contributed to ASF to provide high level access to the CMIS ReST API

This effort, which I’ll probably heavily use in the next days Master Classes and training session, turned out to be quite productive as in a couple of days of work I was able to:

  • develop a Labs framework which wraps Chemistry TCK embedded CMISClient
  • provide an easy CMIS 0.62 application(s) scaffolding platform using a Maven multimodule project
  • produce and release a Maven archetype which is now hosted our partner Sourcesense repositories ( big thanks go to this folks for being always supportive with their Maven maven infrastructure) and can be used as CMIS launchpad / labs / toolkit

Trying it is very easy, due to Maven archetypes power, and you can have the full Labs toolkit downloaded and installed on your by just selecting ‘cmis-master-labs-archetype‘ in the options of the command below:

EDIT

mvn archetype:generate 
-DarchetypeCatalog=http://maven.alfresco.com/nexus/content/repositories/releases/archetype-catalog.xml
mvn archetype:generate 
-DarchetypeCatalog=http://repository.sourcesense.com/nexus/content/repositories/alfresco.public.releases/archetype-catalog.xml

mvn archetype:generate -DarchetypeRepository=http://repository.sourcesense.com/nexus/content/repositories/alfresco.public.snapshots -DarchetypeGroupId=org.alfresco.enablement.codecamps.cmis -DarchetypeArtifactId=cmis-master-labs-archetype -DarchetypeVersion=1.0

This will create a multiproject structure ready for use. You’ll just need to configure (in a single sourced fashion for the whole suite)  the CMIS endpoint properties in the main POM, by editing the following properties:

<!-- SINGLE POINT OF CONFIGURATION FOR CMIS ENDPOINT -->
<properties>
<!-- Configure here the CMIS endopoint For the whole suite -->
<cmisserviceurl>http://192.168.154.128:8080/alfresco/service/api/cmis</cmisserviceurl>
<cmisusername>admin</cmisusername>
<cmispassword>admin</cmispassword>
<cmistracerequests>true</cmistracerequests>
<cmisvalidateatom>true</cmisvalidateatom>
</properties>

All the nice tracing and validation features of the Chemistry TCK are exposed, once that you configured the POM to point to a proper CMIS 0.62 compliant server (e.g. Alfresco, and an Ubuntu Alfresco VM is available here for this purpose). Specifically the toolkit offers 3 Maven submodules

  • cmis-support –> Support JAR which wraps Chemistry TCK CMISClient
  • cmis-query-webapp –> Very basic SpringMVC webapp querying a CMIS repository and showing results/entries
  • cmis-lab-atompub-binding –> Learning lab on how to import data in Alfresco (complete class in the solution folders)

and a lab-solutions folder.

Using it is pretty straighforward. A simple

mvn install

will test the support against the provided configuration, while entering the cmis-query-webapp folder and running

mvn jetty:run-exploded

will result in the (quite ugly) but functional CMIS Query interface you can see below:

CMIS Query Webapp

using a simple three tiered architecture like the one that follows:

CMIS Query Webapp architecture

Lastly entering the lab-atompub-binding folder and running

mvn test

will run the sample JUnit empty test for the data import lab. Solution (real Test class) is to be found in the labs-solutions  folder.

It’s a beginning but I believe it’s a very nice tool to overcome the somehow still steep learning curve around CMIS, so I warmly suggest you start installing the VM and the archetype and play around with it, and even use it as start for your integration/contribution projects. Especially if you are going to attend Alfresco meetups this month. I’ll surely post the Labs slides later this month, so stay posted!

EDIT

The CMIS 1.0 Public Review compliant toolkit (working against Chemistry AtomPub TCK Trunk 1.0) is available on the Sourcesense repository and it’s added to the remote catalo mentioned in the previous command.

As a side note, at the moment this toolkit provide support for CMIS 0.62 while http://cmis.alfresco.com is Alfresco supporting CMIS 0.70: I’m planning to update the archetype (just a mere Maven dependency :) ) to use the HEAD version of Chemistry TCK that is supporting 0.70.

Feedback welcome as usual!

Hope this really helps :)

Aug 03

My first real involvement in Chemistry definitely deserves a first post on the subject ;)

Lately I’ve been involved into refactoring the Alfresco CMIS Test Harness into an external Tck (Test Compatibility Kit) module to contribute to the Apache Chemistry. At the moment it’s mostly focused on the AtomPub part (including an Apache Adbera extension), but being based on Apache Maven standards should be fairly easy to scale out to WebServices binding testing.

This would be this first real contribution from Alfresco to the Chemistry project, where me and David Caruana have the luck of being involved as committers. At the moment the code for the will-be-called chemistry-atompub-tck is still hosted under the Alfresco contrib SVN space as still to be completed, but already offering quite some nice functionalities to test the compatibility of your server to the CMIS 0.6.2 standard.

The code (which was already in Alfresco and kept up to date to the CMIS standard directly by David) is now almost ready for contribution as it’s completely decoupled from Alfresco and uses a standard Maven build process (Junit + Surefire) to run compatibility tests against an existing (and running) CMIS server.

So, running a plain :

mvn test

will run all Junit tests against the specified serviceUrl with specified the username and password, using Maven POM properties as configuration mechanism. Additional configuration can be done in the POM to trace HTTP request/response conversation (useful for debugging purposes), and to configure some behaviors of the HTTP client.

In addition to that, due to the mighty Maven power a small addition to the previous command:

mvn test site:run

will allow you to point to anembedded Jetty server which publishes the test reports and shows errors and exceptions (amongst all the other nice Maven site features).

The idea at the base of this contribution is that this TCK can be used to test virtually any CMIS implementation and Maven profiles provide us a nice way to aggregate the full test fixture and publish the result in a nicely aggregated fashion. In fact, I started defining a profile called ‘alfresco’ which once run with:

mvn test -Palfresco

will configure the TCK to run against an Alfresco provided CMIS reference URL (or to do any Alfresco specific pre-requisite steps, like downloading it, installing a custom model and run it in Jetty for self contained testing).

In the same way I’d like all the other open source vendors involved in Chemistry to maintain their own profile which will serve as community reference for the CMIS readiness of a specific platform. Likewise we could setup ’sharepoint’ or ‘documentum’ profiles to test existing public instances of those CMIS implementors, to always be up to date with their state of the art.

This will, of course, make much more sense once integrated in Chemistry but it’s already fully functional against the CMIS 0.6.2 standard and might be worth a try already. And if you feel to participate to the testing game, why don’t you make a CMIS server instance available and contribute the few lines of POM configuration to the project, filing a nice and easy JIRA issue?

Too much of a salesguy ? :)

Jul 11

(Sorry to my few fellow English speaking readers, but I just took the decision that Spanish language is widespread enough to make my blog multilingual, effective as of now ;) )

Esto tiene que ser mi primer post en Castellano, pero vale la pena intentarlo para compartir con la comunidad hispanofona la disponibilidad (en la Alfresco Content Community) de unas ponencias (PDF) que introducen conceptos teoricos y practicos de Alfresco SHARE y SURF, en Castellano!  Ademas aqui’ hay una introduccion a los projectos basados en Alfresco en contextos institucionales, en Castellano tambien.Presente’ esta ponencias durante los eventos de la semana pasada, hospedados en Valencia por los partners Alfresco Tissat y Indra.Cualquier comentario y consejo seria interesante para mejorar los temas y las practicas (voy a postar el codigo de los labs y ejercicios ASAP, especialmente lo para anadir una Dashlet que se conecta a Twitter).A ver si puede ser util para suportar la ya vibrante comunidad hispanofona!

May 24

Some random note, mostly to myself, to remember, in some dark Maven time, how cool this technology is and that sometimes, at a certain point sure, you CAN have success stories with it.

For now, as I anticipated I’m just playing around with Alfresco core modules, to see how they fit with Maven and how tough can it be to port the full suite.
And you know what guys, on Friday, in just 4 hours I was able to have the core AND webscript framework completely building and tested with Maven (98% success rate).

I mean, it’s just a beginning, but considering that Webscripts are meant/designed to be deployed and integrated also outside of Alfresco, well, you understand the power of having only to add few dependency lines.

I’ll just drop the raw log of my operations, to give you a raw idea what can take for the m10n of an Ant project and how easy it can be if the source project is well maintained and tested.

Alfresco core mavenization (m10n):

  1. Checkout the core
  2. Refactor source tree (source/java –> src/main/java) and test tree (search with Eclipse for *Test.java AND Test*.java and refactor them to src/test/java)
  3. Refactor resources (find them in source –> src/main/resources) and test resources  (find them in source –> src/test/resources)
  4. Create pom via m2eclipse by adding Maven nature
  5. Add dependencies (analyze .classpath file as first step, then cycles of  ‘mvn compile’ and fix)
  6. TIP: Use mvnrepository.com  or even better if you m2eclipse is configured with a proper Nexus/Maven classes index you can directly search deps clicking on the red underline of the compilation error from Eclipse
  7. Install missing/uncertain dependencies on local repo:
    cd alfresco/workspace/alfresco-head/projects/3rd-party/lib/
    mvn install:install-file -Dfile=jta.jar -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1b -Dpackaging=jar
    mvn install:install-file -Dfile=jug-lgpl-2.0.0.jar -DgroupId=jug -DartifactId=jug-lgpl -Dversion=2.0.0 -Dpackaging=jar
    mvn install:install-file -Dfile=ibatis-2.3.4.726-patched -DgroupId=com.ibatis -DartifactId=ibatis  -Dversion=2.3.4.726-patched -Dpackaging=jar
  8. Add target Java 1.5 in Eclipse project and in Maven:
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
    <source>1.5</source>
    <target>1.5</target>
    </configuration>
    </plugin>   
  9. Change line 47 in BaseTest.java
    // FIXME: Refactor this to take resource from classpath
    this.resourcesDir = System.getProperty("user.dir") + File.separator + "target" +
    File.separator + "test-classes" + File.separator;

Results:

Failed tests:
testJarSource(org.alfresco.config.xml.XMLConfigServiceTest)
Tests run: 54, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 2    6 seconds
[INFO] Finished at: Fri May 22 20:32:39 CEST 2009
[INFO] Final Memory: 8M/22M
[INFO] ------------------------------------------------------------------------

Well pretty cool if you consider only a couple of hours of work, 54 tests out of 55 working again ;)
That’s refactoring yeah!

Webscript Framework mavenization (m10n):

Pretty much the same steps, some dependency to deploy but basically the same trick.

Nice to note, under modules coupling POV, that the only intra-Alfresco dependency of the Webscript Framework is the Core, so that in another couple of hours I was able to run a

mvn clean install

on the Webscript frameowork project, with the following result:
Failed tests:
testRemoteStore(org.alfresco.web.scripts.TestRemoteStore)
testRemoteClient(org.alfresco.connector.TestRemoteClient)
Tests run: 16, Failures: 2, Errors: 0, Skipped: 0
[ERROR] There are test failures.
Please refer to /Users/mindthegab/Dev/alfresco/workspace/WebScript Framework/target/surefire-reports for the individual test results.
[INFO] [jar:jar]
[INFO] Building jar: /Users/mindthegab/Dev/alfresco/workspace/WebScript Framework/target/alfresco-webscript-framework-3.2.0-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing /Users/mindthegab/Dev/alfresco/workspace/WebScript Framework/target/alfresco-webscript-framework-3.2.0-SNAPSHOT.jar to /Users/mindthegab/.m2/repository/org/alfresco/alfresco-webscript-framework/3.2.0-SNAPSHOT/alfresco-webscript-framework-3.2.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14 seconds

Ok needs refinement, and a proof of concept of integration in some webapp, but I feel already like all the “glue” power of Maven can be an additional enabler to such a feature-ful platform like Alfresco.
Suggest to stay tunes as I’ll definitely post more on this :)

May 23

How come writing is always the last thing?
Before it was blogging, now fashion says we must micro-blog, and we even don’t have time to spend a few words on what we do. Effective as business, but blogging gave us a bit of writers pride, isn’t it? But it goes much earlier than that…the vast majority of software projects is developed almost until the end without any piece of seriously meaningful documentation.

Ok, ok, stop!

I was just finding lame philosophical excuses for not having blogged anything in this period of my life, such dense of changes in many aspects of my life and career. And this blog post keep staying in the infinite backlog of my TODOs.

May you live in interesting times

seems to run a famous Chinese or supposed to be Chinese curse, which I actually heard for the first at the Alfresco Rome’s meetup during my new CTO - John Newton - presentation, but that reflects the current status of my life, career and more in general world there days. Continue reading »

Jan 29

It’s probably my first real recognition in open source matters. More soon will come, as I’m really putting my heart in the cause.
It was a nice surprise in fact to get to see my big face on Alfresco’s wiki home page, having been nominated January’s contributor of the month for the work on Alfresco and the Maven Archetypes.

Even if, I guess, the photo I sent the Alfresco guys reflects my vain nature ;)

Good stuff, especially as I’m trying to release the 3.0 version of the archetypes in a matter of days.  Stay posted on 3.0.0 branch and on Sourcesense’s repo. And why not contribute? :)