22
CQ5 Development Setup, Maven Build and Deployment with Dan Klco Six Dimensions www.sixdimensions.com www.6dlabs.com 6/21/2012

CQ5 Development Setup, Maven Build and Deployment

Embed Size (px)

Citation preview

Page 1: CQ5 Development Setup, Maven Build and Deployment

CQ5 Development Setup, Maven Build and

Deployment with Dan Klco

Six Dimensions

www.sixdimensions.com

www.6dlabs.com

6/21/2012

Page 2: CQ5 Development Setup, Maven Build and Deployment

2

About Me

Yes, that is how my last name is spelled

WCMS space for 5+ yearsEMC WebPublisher/Documentum, Drupal, CQ5…

Participated in many WCM ImplementationsSmall, medium and large projectsMultiple different technologies and build methodsSupport, enhancement, migration and new

implementations

Page 3: CQ5 Development Setup, Maven Build and Deployment

3

PurposeWhat is the purpose of this webinar?

To understand why your project structure, build process and deploy process are important

To explore methods of building and deploying CQ5 projects

To learn about current best practices and industry-leading tools

Page 4: CQ5 Development Setup, Maven Build and Deployment

4

Why is my build process important?“Oh, I just wish I understood why. Why I should care.” – Zap Brannigan

Page 5: CQ5 Development Setup, Maven Build and Deployment

5

Bad build process results in…Chaos

Not sharing complete code baseNo code/application versioningNo single version of the ‘truth’

Slow build process Increased testing turnaroundSlower developer progress

Difficult release process

Page 6: CQ5 Development Setup, Maven Build and Deployment

6

Build Processes - ManualBuild from CRXDE & Packages

Advantages: Easy, works out of the boxDisadvantages: chaos, code versioning difficult

Build from CRXDE & SVNAdvantages: share code, easy, works out of the boxDisadvantages: more complicated builds, SVN

integration awkward

Page 7: CQ5 Development Setup, Maven Build and Deployment

7

Build Processes - AutomaticBuild from IDE & ANT

Advantages: Very customizable, automatic, any SCM supported

Disadvantages: lots of extra development, mostly not out of the box

Build from IDE & MavenAdvantages: customizable, automatic, any SCM

supported, most tasks available as plugins, integrated dependency management

Disadvantages: not out of the box

Page 8: CQ5 Development Setup, Maven Build and Deployment

8

Klco’s Hierarchy of Build Needs

Page 9: CQ5 Development Setup, Maven Build and Deployment

9

Implementing Maven BuildsI preferred the notion of convention over configuration. I wanted a project's infrastructure to look the same and work the same…

-Jason van Zyl

Page 10: CQ5 Development Setup, Maven Build and Deployment

10

Maven Build RulesIDE/platform agnostic

Perform all operations

Properties should be centralized

Page 11: CQ5 Development Setup, Maven Build and Deployment

11

Project StructureMaven reactor, manages

building of sub-modules

Major code functionality separated into different projects

All code built into a single package by the package project

/Root/Core

/Services

/Taglib

/Servlets

/Vault

/Package

Page 12: CQ5 Development Setup, Maven Build and Deployment

12

Resolving DependenciesHosted Maven Repository -

http://archiva.apache.org/docs/1.3.5/quick-start.html

Advantages: most control, deploy custom artifacts Disadvantages: setup, hosting cost, requires internet access

Local Maven Repository - http://dev.day.com/content/kb/home/cq5/Development/maven/HowToUseCQ5AsMavenRepository.html

Advantages: easy, always available Disadvantages: not shared with team

Adobe Maven Repository - http://repo.adobe.com/nexus/content/groups/public

Advantages: latest code, can browse repo Disadvantages: cannot deploy artifacts, requires internet

access

Page 13: CQ5 Development Setup, Maven Build and Deployment

13

Developer Toolsm2e – Maven Plugin for Eclipse

Run Maven Builds inside Eclipse Import and configure Maven projects from any SCM

VaultClipse - Import/Export ToolQuick Push/Pull from CQ Repositories

J2EE Eclipse Includes JSP, CSS & XML Editors

Page 14: CQ5 Development Setup, Maven Build and Deployment

14

Required Maven Plugins

Bundle Plugin for Mavenhttp://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

Used to enable Maven to create OSGi Bundles.

Apache Felix Maven SCR Pluginhttp://felix.apache.org/site/apache-felix-maven-scr-plugin.html

Generates SCR descriptors based on Apache Felix SCR Annotations.

Page 15: CQ5 Development Setup, Maven Build and Deployment

15

Deployment OptionsCQ Deploy Plugin

http://cq-deploy-plugin.6dlabs.com/

Advantages: deploys bundles, legacy API, easy use, maven central

Disadvantages: not as full-featured

Content Package Maven Pluginhttp://dev.day.com/docs/en/cq/current/core/how_to/how_to_use_the_vlttool/vlt-mavenplugin.html

Advantages: feature rich, easy use Disadvantages: does not deploy bundles

Groovy/cURL Scripts Advantages: completely custom Disadvantages: more to maintain, not future-proof

Page 16: CQ5 Development Setup, Maven Build and Deployment

16

Continuous IntegrationIntegrate Early and Often

-Gerard Meszaros

Page 17: CQ5 Development Setup, Maven Build and Deployment

17

What is Continuous Integration

Dedicated server or application

Continuously builds and deploys code

Runs automatically – can also be kicked off manually

Page 18: CQ5 Development Setup, Maven Build and Deployment

18

Benefits of CIIntegrate early and often

Constant and frequent builds

Automated deployments

Early warnings of broken/conflicting code

Automatic Unit Test & Code Quality checks

Blame!

Page 19: CQ5 Development Setup, Maven Build and Deployment

19

CI Best PracticesAny CI Maven-capable Server will work

CI Server should install to DEVAuthor and PublishManual release process to QA & Prod

Run at least daily

Ideally every hour or two or when code is updated

Same build process as Local Developers and releases

Page 20: CQ5 Development Setup, Maven Build and Deployment

20

Code LifeCycle

Page 21: CQ5 Development Setup, Maven Build and Deployment

21

Problems & PitfallsCSS & designer Integration

Large Team Sharing/Duplication

Naming Conflicts

Misalignment Between Teams (Integration Hell)

Page 22: CQ5 Development Setup, Maven Build and Deployment

22

Thank You!6D Labs & Six Dimensions

For more information please contact:TJ Iaciofano: [email protected]

www.6dlabs.com

www.sixdimensions.com