Alfresco SDK 2.0.0 is (finally) out! Merry XMas Alfresco Devs :)

1182
Christmas according to JoyOfTech

I could not possibly hold onto this anymore. After about 3 months of very caring testing of the Community, nurturing, launches, 4 betas and 2 Release Candidates, it’s with extreme pleasure that I can finally announce the so much awaited (and hopefully the best to date) Christmas present for all Alfresco developers out there: the Alfresco SDK 2.0.0 is now released and available in Maven Central!

Here all the details for this release:

Apart from some major internal refactoring to simplify POMs, maximize OOTB cross IDE (tested with Eclipse Luna and IDEA) compatibility and improve performances, key features for this release include (but are not limited to):

  • All Alfresco SDK 2.0.0-beta-4 features, including hot Java code reloading, native IDE integration, a Share AMP archetype and  remote JUnit testing,
  • Simplification of Enterprise development, with the introduction of a -Penterprise profile to simply configure your build to work against Alfresco Enterprise 5.0.
  • Embedded h2 database support, deprecating the external project alfresco-h2-support … thank Carlo for filling this gap for way too long already!

I really do hope this is a welcomed and so much needed addition to the Alfresco Development ecosystem and just the first step in my new Product Management career towards an ever improving developer experience on top of the coolest ECM framework out there!

Looking forward to your feedback here in the comments or even better as issues or contributions to the Alfresco SDK Github project.

Happy Holidays, now off to some well deserved rest since next year is going to be full of exciting challenges!

My #AlfrescoSummit 2014 San Francisco recap, and tips for a successful Alfresco project!

Last week’s Alfresco’s Summit in San Francisco was a blast. Every single day. Every single moment (ok well not the night before the preso, when I had to finish

Here’s a day by day recap of my #AlfrescoSummit, the uncountable reasons why I love this event and why you might want to book a last minute spot at Alfresco Summit, and join us in London next week:

Maven Hipsters
Mehven hipsters sabotage!
  • On day 1: together with Mao, we delivered a 4 hands talk called “Get Your Alfresco Project from Zero to Hero with Maven Alfresco SDK and Alfresco Boxes”, finally covering the automation of the full Alfresco project lifecycle! Check out the slides below, for the ultimate approach to Alfresco project lifecycle, a combination of the:
    • the world class developer experience provided by the Alfresco SDK 2.0
    • the highly automated provisioning / deployment of arbitrarily complex architectures provided by Alfresco Boxes (supporting technologies like Vagrant, Packer, Docker and chef-alfresco).

  • On day 2: I delivered a (hopefully) very well received talk called “10 things you need to know to have a successful Alfresco Project”. I tried in a few slides to gather the top ten common mistakes or overlooks I have seen in my now 7+ years of Alfresco career, in every phase of the project lifecycle, from inception to development, from release to deployment and distribution. As part of this talk, I also introduced for the first time a pilot of the Alfresco Developer Support service, a support add-on package dedicated to Enterprise customers and partners who extensively develop on our platforms and require access to highly skilled senior Alfresco engineers on development matters. Check out the slides below and don’t hesitate reaching out to me if you are interested in the Dev Support service:

On top of my contributions to this Summit, it’s been amazing to:

  • Attend Doug’s, John‘s and Thomas’ keynotes, which were were simply FANTASTIC! So excited to be part of a hugely growing product, which is revolutionizing the way knowledge workers can be  productive in their daily job, while being fully engaged and driving the humongous amount of content that we produce everyday to the degree of control the modern Enterprise requires. Come and join in London for this fantastic outlook on the upcoming Alfresco 5!
  • Get to meet (again) many of the Alfresco gurus I remotely work with on a daily basis. Spending a whole week with great Alfrescans like Peter Monks, Maurizio Pillitu, Greg Mehlan, Gethin James and so many other is really refreshing! Not just from a purely technical standpoint, but most importantly that’s was REAL fun – as Peter’s picture clearly here on the right shows – btw the Italian mullet is a present of mine!)

    Peter Monks, the first Mulleteer! :)
    Peter Monks, the first Mulleteer! 🙂
  • Network with so many smart partners and customers, getting their feedback on the product, the SDK and how we can help driving you to continuous customer success!
  • Get to meet the Community and not only get (very personally satisfying, have to admit) exciting feedback on the SDK 2.x version but also seeing Order of the Bee t-shirts proliferating was a really positive sign of a growing, lively and never so important Alfresco Community! Nice to see you again Bindu and looking forward to see you Ole! (just to name 2!)

Well I hope I have given you one more reason to come and see us at Summit.

Especially as I relocated to the US, I really look forward to meet many of the long term Alfrescans Community & Enterprise members of the good old European community next week in London!

See you there? 🙂

Alfresco SDK 2.0-beta-4 released in Maven Central!

It’s with extreme pleasure that, thanks to the great support from the Order of the Bee and the Community at large, we have released the Alfresco SDK 2.0.0-beta-4 … this time in Maven Central!

And 2.0.0 release is on the way, definitely out for you to use at the Alfresco Summit!

If you just can’t wait, check out a full tutorial and overview of new hot reloading features and IDE integration in this video (kudos to Ole for putting this together):

If you check out docs and release notes, I hope you’ll be gladly surprised by the number of enhancements and bug-fixes that went in this release, which, without any doubt, is to date the greatest ever achievement in ergonomics, productivity, quality and automation of Alfresco development! This represents a major step towards driving the Alfresco Community to become an organic, self sustained, proactive ecosystem of extensions and plugins for our favorite platform, Alfresco!

There are so many new features in this release, some of them very notable and I’d like to share them with you:

  • Compatibility with Alfresco Community 5.0.a+ (and soon with the upcoming Alfresco Enterprise 5.0.x). For 4.2 and below, you still need to use the SDK 1.x (see full SDK / Alfresco compatibility matrix here)
  • Availability on Maven central (see screenshot below)! Any Maven developer can just run a simple mvn archetype:generate and quickly create Alfresco projects directly from Maven Central! Is this JUST awesome?
Generate Alfresco Projects from Maven Central!
Generate Alfresco Projects from Maven Central!
  • True IDE integration with Eclipse, Idea and Netbeans (just Import Maven Projects) with rapid development support, by hot reloading of your Java classes, Web resources, webscripts, freemarker templates, using Spring Loaded and advanced Tomcat7 features (check out again the video above, you likely need to see it twice to believe it 🙂, to get all excited and farewell to all those ugly slow Alfresco restarts 🙂
  • Unit and integration testing support, with remote JUnit testing features to avoid context reloading and run unit tests (from your IDE) in seconds (or less)
  • Easy new starter setup and run scripts in each archetype. Just create the project, execute ./run.sh and off you go!
  • Updated SDK 2.x docs (separate from SDK 1.x docs)
  • rm profile (enable with -Prm) in the all-in-one archetype to enable Records Management development
  • Multiple bug fixes and stabilization

The feedback we got is that this new version is just AMAZING and enables levels of productivity never seen before on Alfresco project. And, for those of you that have followed me in this journey started 6 years ago, this shouldn’t be anything less than mind-boggling.

I really wish you will experience the same and I’d love to hear your feedback and contributions. I’d welcome comments here, issues or pull requests on the SDK project, or even emails on the Maven Alfresco mailing list. Also, stay tuned, since 2.0.0 final is targeted to introduce new juicy features, like easy Selenium functional testing,  even easier configuration of Community / Enterprise artifacts via a simple profile and integration of the Alfresco Technical Validation tool to ensure quality of your extensions.

And if this is getting you half as excited as I am right now, make sure you come to the next month’s Alfresco Summit (in San Francisco or London) where, together with Maurizio, we’ll extensively present how, in just 50 minutes, you can leverage the Alfresco SDK to get your project from inception to its first release and how, using Alfresco Boxes, you can consume this release and deploy arbitrarily complex architectures, on premise or in the cloud, in FULL automation.  Now that’s what I call an overarching vision

And if you really want to become a Guru, come join the Maven Alfresco training that Maurizio will run in both venues, one very worth day spent to save days of sub-optimal development 🙂

Stay tuned and send us your feedback!

[Maven is not so evil] Avoid webapp redeployment with hot reloading of your Maven project in Eclipse and IDEA. For free? Yes, with Spring-loaded and Tomcat7 :)

This might be the most important feature we have ever added to the (Maven) Alfresco SDK, which explains why we are getting such an amazing feedback following yesterday Tech Talk Live, where we presented the fully hot reloading (no webapp-context reload) early 2.0 version of the SDK.

BTW, if you are an Alfresco Developer and you have missed the talk, I (and not just myself) really recommend you take a hour of your time and check out the recording of the talk and / or the slide deck, because, if you are used to the sometimes frustrating world of WAR reloading (especially with a 100M+ webapp like Alfresco), I really do hope the demo of the new SDK will be no less than mind boggling for you…

Or, well, at least half as excited as I was when I first saw Ole‘s early attempts and when I finally got it working integrated in the SDK just a couple of days ago. Eureka! was my reaction to say the least (and in honor of my Sicilian past, a reference to Archimedes never hurts :).

I figured though that it’s not only Alfresco Developers that can benefit from this new approach, but more in general the community at large of Java developers using Maven to develop J2EE webapps in conjunction with an IDE (tested on Eclipse, IDEA, Netbeans).

And I know first hand the pain it takes to wait for neverending reloads, being this one of the main concerns around Java development with respect to newer / interpreted frameworks which make RAD (Rapid Application Development) their mantra.

So I figured I shared with all of you, eager blog readers, the couple of (simple) tricks that we used to define what, hopefully once and for all, can become the standard de facto to boost rapid develop Java webapps on Maven, in a completely IDE independent (but integrated) way and without the need for proprietary tools like JRebel.

So here we go. Assuming you have a WAR project, follow this steps to forget once and for all lengthy and boring WAR reloading (and contextually drink less coffeee!):

  1. The first building block is spring-loaded, a library from Spring.io (used to provide hot reloading to the GRails2 framework). This library (free of charge) provides a JVM agent which, transparently, provides class files reloading. All you need to do is get the spring-loaded.jar (e.g. from here) and then run your build with the agend enabled as such:
    MAVEN_OPTS="-javaagent:/path/to/downloads/springloaded-1.2.0.RELEASE.jar -noverify" 
mvn <goals>
  2. The second building block is based on the Tomcat7 VirtualWebapp features. This allows to: configure, via webapp context.xml, your webapp to dynamically load classpath resources (with the and webapp Loader component) and web resources (via ResourcesVirtualDirContext)  from outside a physical WAR / exploded folder. This way it’s very easy to configure your Maven <war> packaging project to automatically load classpath and web-resources directly from where Maven (or your IDE) would compile them, i.e. ${project.build.outputDirectory} (for your classpath resources) and ${project.build.directory}/${project.build.finalName} for your webapp resources. Basically you just need to create a context.xml file in your Maven project (e.g. in this example in the ${project.basedir}/tomcat folder that looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context docBase="${alfresco.client.war.folder}" path="${alfresco.client.contextPath}">
      <Resources className="org.apache.naming.resources.VirtualDirContext" 
      extraResourcePaths="/=${project.build.directory}/${project.build.finalName}" />
    <Loader searchVirtualFirst="true" className="org.apache.catalina.loader.VirtualWebappLoader" virtualClasspath="${project.build.outputDirectory}" />
    </Context>
  3. Once the two building blocks are in place, you just need to wire this in the Maven pom.xml for your war packaging project. You could use Cargo but my dark memories of pain using that plugin suggest that a better, easier and more maintained route is to use the shiny tomcat7-maven-plugin. All you need to do is telling tomcat to use the previously defined context file by specifying:
     <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>run-embedded</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>pre-integration-test</phase>
            <configuration>
               <useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
               <contextFile>${project.basedir}/tomcat/context.xml</contextFile>
            </configuration>
          </execution>
        </executions>
      </plugin>

    NOTE: this is going to bind the tomcat7 plugin to run your WAR, with the RAD configuration, during the pre-integration-test phase.

  4. Now you can run your build with:
    mvn clean integration-test

    and you will see your webapp run in Tomcat7. Nothing spectacular yet, but go the next point 🙂

  5. Now import your Maven project in Eclipse (Luna has already the Maven integration by default) or IDEA and there the fun begins! If you make a change to an existing Java class or web resource, all it takes is for you to hit refresh on your browser and AUTOMAGICALLY changes are there! No more webapp reloads, no more waiting time, just have fun!
  6. If you want an example of how this approach can save you huge amounts of time (and hairloss :P) check out the video below:

Hope you enjoyed what you see and hope you can leverage this ASAP! Feedback and comments are welcome, but in the meanwhile a nice collective farewell to silly webapp reloads 🙂

(Maven) Alfresco SDK migrated to Github!

+  =

As anticipated, I have today completed the migration of the (Maven) Alfresco SDK to the Alfresco Organization in Github.

The new location for the project is https://github.com/Alfresco/alfresco-sdk. Issues and code are already there, let me know if I missed something obvious or if you don’t have the right access to the project.

After 6 years in Google Code, we decided to move to Github to foster even more contributions and an ever growing flourishing community around the Alfresco SDK! I’m excited! 🙂

The old Google Code project location is temporarily still there for a limited amount of time, but I plan to close it for good and redirect to the Github location.

So, what else can I say?

Well, FORK US 🙂

Maven Alfresco SDK 1.1.0 is out and supports Rapid Application Development!

 

 

 

 

Just in time for the Alfresco Summit in Barcelona, we are proud to announce that the Maven Alfresco SDK 1.1.0 is out!

In this release (tested with Alfresco 4.2.e Community and supported with Alfresco 4.2.0 Enterprise) we have focused to make the development experience even faster, on top of keeping all process oriented and automation SDK features.

Key features that you might be interested in (and hopefully very excited about) are:

  • JRebel integration to allow zero redeployments when developing Alfresco Java components
  • Support for running JUnit test on a running Alfresco instance, in fractions of a second, not minutes. This leverages junit-remote and requires JRebel to hot reload classes
  • A new profile ‘-Prad’ to enable the 2 aforementioned features
  • Jetty replaced with Tomcat7 embedded, for improved supportability
  • Multiple fixes and improvements in the Eclipse integration
  • Works with Alfresco 4.2.e Community and Alfresco 4.2.0 Enterprise

This release represents a major improvement towards a full supportability of the SDK when working with Alfresco Enterprise, as well as providing a way to develop customizations in minutes, not hours.

Hope you enjoy it, feedback and contributions more than welcome, here or in the Google Code project!

EDIT: Slides are available on the Summit website. Apologies to everyone who asked before for not having uploaded them before the presentation!

Maven Alfresco SDK 1.0.2 is out and ready for your enjoyment :)

Just a quick update for the Alfresco Mavenistas, as yesterday we released the Maven Alfresco SDK 1.0.2!

This is a (major) maintenance release for our preferred Alfresco SDK (see full 1.0.2 release notes), and I wanted to stress a couple of fixes who went in there which might drastically improve your development experience:

  1. As I described in my last post, if you are a Linux/Mac SDK user, then your build is probably going to speed up 5x to 10x times. This is thanks to a fix using the plexus-archiver…I look forward to hear your wows from here 🙂
  2. The latest MMT fixes are in there. This should fix any weird issues of your build in case you were overriding Alfresco resources

You can find official documentation and artifacts on the Alfresco Artifacts repository.

And BTW, I suggest you stay tuned on this channel as I have worked hard in the last months on a plan for a full Mavenization of Alfresco…and you all know what that would mean for the functionality and “coolness” of our SDK 🙂

[Maven is not so evil] Plexus-archives 2.3 is a life saver

Maven is very good with J2EE WARs. Resources, packaging, overlays.

I admit that if it wasn’t for the great features and clean development model imposed by the maven-war-plugin, I would not even probably looked at Maven in the first place when I developed the first version of the Maven Alfresco SDK.

Lately though, especially working with large WARs overlays like Alfresco (120MB) and Share (40MB), I have seen all my efforts for standardized development falling badly short on the rapid development side. Suddenly (on my Mac, or I assume on any Unix/Linux environment) my WAR overlays started to take minutes to complete, with a big so long to the quick dev-fix-test cycle. As a Java performance expert, I decided to debug it and understand where it was actually wasting time.

Turns out that for each and every unpacked resource from WAR overlays the Maven unarchiver would fork a chmod process, to modify some file permissions!!! (Windows users, you can stop reading here 🙂

Leaving out that I’m not sure of the original reason for this, I later found out (also thanks to Samuel, kudos!) that this was due to a misconfiguration of the plexus-archiver package, which instead of using native JVM chmod capabilities was forking the process. All details unfolded in a related maven-dependency-plugin issue, MDEP-368.

Basically turns out this properly fixed in plexus-archiver-2.3 (the Maven shared component used by plugins to manage ZIP & co. archives), where no process is forked and the overall WAR packaging / overlay time is reduced drastically. And now the fix, and later the wow effect (I hope) :)))

Luckily enough the fix is pretty simple and only requires to have your plugins (unless they do it already) depend explicitly on plexus-archiver version 2.3. In other words just add the following snippet (the example is for the maven-war-plugin, but you can use the trick for the maven-dependency-plugin and any other plugin you see poorly performing on resource unpacking) to your pom.xml:

 <plugin>
     <artifactId>maven-war-plugin</artifactId>
     <dependencies>
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-archiver</artifactId>
             <version>2.3</version>
         </dependency>
     </dependencies>
 </plugin>

EDIT: This is fixed in the maven-war-plugin version 2.4 (and you don’t need the explicit plexus-archiver dependency anymore), see related issue MWAR-280).

Just to give you an idea how the performance improvements with this little fix, I will use as an example the Maven Alfresco All-In-One Archetype, which allows to develop and run an Alfresco Repository, Share, Solr and an AMP in the same Maven multi-module project. The SDK currently does NOT use plexus-archiver 2.3 (there is an issue for it), so it’s extremely (and unnecessary) slow in the Alfresco and Share overlays.

After I created the project from the archetype as per docs, here’s the output of a simple

mindthemac:alfresco-parent mindthegab$ mvn clean install -DskipTests
...
[INFO] Reactor Summary:
[INFO]
[INFO] Quickstart of Alfresco and Share with DB and runner embedded  SUCCESS [0.978s]
[INFO] Alfresco AMP Module ............................... SUCCESS [11.271s]
[INFO] Alfresco Repository and Explorer Client ........... SUCCESS [4:10.599s]
[INFO] Alfresco Apache Solr customization ................ SUCCESS [6.504s]
[INFO] Alfresco Share Client ............................. SUCCESS [4:08.038s]
[INFO] Alfresco and Share Runner ......................... SUCCESS [0.045s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8:41.062s
[INFO] Finished at: Thu Jun 20 14:54:35 CEST 2013
[INFO] Final Memory: 38M/782M
[INFO] ------------------------------------------------------------------------

What? 8m41s total build time? 4 minutes for each WAR? On my very decent Mac 8GB RAM+SSD?

Such a slow cycle is just going to kill the Maven Alfresco Community, to be a little dramatic 🙂

And now, get ready for the wow…after applying the little plexus-archiver fix above (in the parent POM <plugins> or <pluginManagement> sections) this is the amazingly improved performance of the vary same build:

mindthemac:alfresco-parent mindthegab$ mvn clean install -DskipTests
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Quickstart of Alfresco and Share with DB and runner embedded  SUCCESS [0.848s]
[INFO] Alfresco AMP Module ............................... SUCCESS [5.630s]
[INFO] Alfresco Repository and Explorer Client ........... SUCCESS [35.372s]
[INFO] Alfresco Apache Solr customization ................ SUCCESS [5.054s]
[INFO] Alfresco Share Client ............................. SUCCESS [23.945s]
[INFO] Alfresco and Share Runner ......................... SUCCESS [0.019s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:13.143s
[INFO] Finished at: Thu Jun 20 15:56:43 CEST 2013
[INFO] Final Memory: 44M/496M
[INFO] ------------------------------------------------------------------------

WOW!!!  Only 1m13 total build time…a neat 85.96% build speed up 🙂

I think it’s really worth making sure this trick is known as it’s going to be a life saver to the Maven Alfresco SDK and I’m also using it to speed up our internal Alfresco Maven builds.

Hope you find this useful, to the next tip of this newly born Maven post series!

Maven Alfresco SDK 1.0 is finally out and ready for you to enjoy!

It’s been a long journey, but we made it 😉

It started almost 5 years ago, and through the years, little by little, we made giant steps towards an open development platform.

If you have followed this blog earlier, you probably have shared some of the pain for an unnecessary difficult integration process of Alfresco artifacts, therefore today we should all re-joy as development on Alfresco got just so much better 😉

Thanks to the great work of the whole Maven Alfresco Community and the strong momentum and Support from Alfresco Engineering and Release Management, it’s with extreme pleasure and pride that I announce you that a fully fledged Maven Alfresco SDK™ 1,0 is now available for your enjoyment and to drastically improve your development productivity on Alfresco projects.

While I recommend to you have a look at the full docs and to the release notes to understand the full extent of features of this brand new piece of software, let me just give you here an overview of the  most exciting features:

  • Zero configuration approach: create an AMP or All-in-One archetype and with one command you are ready to run and customize Alfresco. In the very same place 🙂
  • Zero download approach: the SDK will take care of downloading the appropriate Alfresco artifacts from the Alfresco Artifacts Repository. Also no DB or application server is required, as the SDK will runAlfresco emdedded on Jetty + H2.
    Note:
    this configuration is not part of the supported stacks, so should be used only for development purposes
  • Zero BS development approach: with new SDK the focus is your creativity, no more boring configuration or hacks to make a particular work.  Just get the setup right with an archetype and start to kicking it on Alfresco 🙂
  • Zero defect is the main objective of the SDK: with support for AMP unit and integration testing, as well as integration with the strong enterprise development process feature of Maven (e.g. CI, release mgmt, etc.), you can get you Alfresco development to another level. This was made thanks to the availability of POM files for Alfresco Artifacts (as of Alfresco 4.2.b).

NOTE: For those of you wondering about naming and version: yes, the Maven Alfresco SDK 1.0 superseded the old version of the Maven Alfresco Archetypes / Lifecycle 3.9.1.  As of Alfresco Community 4.2.b the Maven Alresco SDK 1.o is the recommended solution.

But without further ado, I can’t wait to join the other Alfresco Rockstarts at the DevCon hackaton, I’m sure we can boost some productivity down then with this SDK. Once again, check out the project website for full docs.

I want to thank you everyone involved in making this happen (especially Mao and Samuel) as we believe it will be a major improvement for the developers, architects and administrators of Alfresco project, finally providing a solid foundation to doGreatWork() and this great product.

Enjoy and let us know your feedback!

Maven and Scalability @ DevCon

Sounds like it’s happening. More, much more that I could expect. Much better than before.

At Alfresco in fact we are finally about to close on two fundamental areas like ECM Scalability and on the availability of a fully fledged Maven based SDK.

As you might know (if you are reading this blog you probably will), these on the two areas I’ve always been passionate and involved for in the last few years. Just to let you understand how passionate (or romantic, almost Italian) about these topics, enough for you to know that:

    • I ranted about Maven for a few years now and, in this last year, I experienced a momentum never seen before both from a corporate and from a community standpoint. Literally, about to cry here 🙂
    • I worked for many years as Alfresco Partner and Solution Engineer, without having a quantitative sizing and performance reference for my implementations. In the last year I participated to the Alfresco Benchmarks project, which has shown very interesting results and improved the scalability of our system exponentially. I am so excited about these improvements, both at process and product level, that I can’t wait to share those with you 🙂

So it’s just a great pleasure and excitement for me to confirm we have a couple of so much awaited HUGE surprises on those areas 😉

But without further ado then, it’s my pride to officially announce that …


…no wait, I have a better idea.

If you are really interested and you want to know what’s going on around Performance and SDK, it’s quite simple: you should just come by for one of the two great DevCons (Berlin and San Jose) that are approaching in November 🙂

I will give two speeches at both EMEA and Americas DevCon, surprisingly enough about:

And if you are not convinced, hear is a little teaser 😉