cq maven methods
DESCRIPTION
Presentation “CQ Maven Methods“ by Andrew Savory at CQCON2013 in Basel on 19 and 20 June 2013.TRANSCRIPT
![Page 1: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/1.jpg)
CQ MAVEN METHODSCQCON 2013
![Page 3: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/3.jpg)
Joined Adobe in November 2012
![Page 4: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/4.jpg)
CQ Newbie
JCR/CMS/TLA old hat
![Page 5: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/5.jpg)
Background in Open Source, Content Management, Mobile
![Page 6: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/6.jpg)
Talking today about what I learned so far...
![Page 7: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/7.jpg)
FORK ME!If you found this talk useful, or spotted mistakes:
github.com/savs/CQCon_2013_CQ_Maven_Methods
![Page 8: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/8.jpg)
IN YOUR BROWSERhttp://goo.gl/qqS1F
![Page 9: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/9.jpg)
SEE ALSOhttp://www.planetcq.org/
![Page 10: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/10.jpg)
![Page 11: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/11.jpg)
![Page 12: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/12.jpg)
LET'S BUILD A CQ SITE
... uh, where to begin?
![Page 13: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/13.jpg)
METHOD 1Enthusiastically rush in, use CRXDE Lite
![Page 14: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/14.jpg)
METHOD 2I'm a guru, I use Eclipse and CRXDE
![Page 15: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/15.jpg)
METHOD 3I'm a ninja, I use emacs and vlt
![Page 16: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/16.jpg)
METHOD 4I'm a guru ninja, I use vi and curl
![Page 17: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/17.jpg)
METHOD 5
See also: http://xkcd.com/378/ – Real Programmers
![Page 18: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/18.jpg)
BUT WHAT ABOUT ...reverting mistakes?
reproducible builds?
collaborating with others?
deploying to production?
![Page 19: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/19.jpg)
WHY ISN'T IT EASIER TO BUILD A CQ SITE?Laborious project inception
No two projects alike
Don't know project layout
Don't know project dependencies
Hard for others to reproduce
Hard to test
Lengthy RTFM or worse (no FM)
Documentation over convention
![Page 20: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/20.jpg)
CQ SUCKS
![Page 21: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/21.jpg)
$PRODUCT SUCKS
![Page 22: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/22.jpg)
YOUR METHODOLOGY SUCKS(sorry)
![Page 23: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/23.jpg)
SO HOW DO WE FIX THIS?Maven
Git(or Subversion, or CVS ... ymmv)
Best Practices
![Page 24: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/24.jpg)
MAVEN“Maven is a software project management
and comprehension tool. Based on the
concept of a project object model (POM),
Maven can manage a project's build,
reporting and documentation from a central
piece of information.”
![Page 25: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/25.jpg)
GIT“Git is a free and open source distributed
version control system designed to handleeverything from small to very large projects
with speed and efficiency. ”Version control is a system that records changes to a file or set of files over
time so that you can recall specific versions later.
![Page 26: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/26.jpg)
BEST PRACTICES“A best practice is a method or technique that
has consistently shown results superior tothose achieved with other means.”
In addition, a "best" practice can evolve to become better as improvementsare discovered.
![Page 27: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/27.jpg)
WHAT DO WE WANT?Minimal customisation
Standardised way to create a project
Standardised way to build a project
Standardised way to deploy a project
Standardised way to test a project
Standardised way to share a project
![Page 28: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/28.jpg)
OUR TARGET
![Page 29: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/29.jpg)
Success criteria:
IT'S EASY TO BUILD A CQ SITE!
![Page 30: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/30.jpg)
GETTING STARTEDInstall Maven: http://maven.apache.org/guides/getting-
started/
Install Git: http://git-scm.com/book/en/Getting-Started-Installing-Git
![Page 31: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/31.jpg)
CONFIGURING MAVENMaven has a settings file that defines things likerepositories where plugins can be downloaded (typically~/.m2/settings.xml).We need to add a profile to point to the Adobe repository.We then specify this repository when we use thearchetype plugin.
See also: Obtaining the Content Package Maven Plugin
![Page 32: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/32.jpg)
CONFIGURING MAVEN<profile> <id>adobe-public</id> <activation> <activeByDefault>false</activeByDefault> </activation> <properties> <releaseRepository-Id>adobe-public-releases</releaseRepository-Id> <releaseRepository-Name>Adobe Public Releases</releaseRepository-Name> <releaseRepository-URL>http://repo.adobe.com/nexus/content/groups/public</releaseRepository-URL> </properties> <repositories> <repository> <id>adobe-public-releases</id> <name>Adobe Basel Public Repository</name> <url>http://repo.adobe.com/nexus/content/groups/public</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>adobe-public-releases</id> <name>Adobe Basel Public Repository</name> <url>http://repo.adobe.com/nexus/content/groups/public</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories></profile>
![Page 33: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/33.jpg)
CONFIGURING MAVENEnable the repository:
Or use the -P option to activate profile(s):
<activeProfiles> <activeProfile>adobe-public</activeProfile></activeProfiles>
mvn -P adobe-public [...]
![Page 34: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/34.jpg)
USING MAVEN
![Page 35: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/35.jpg)
STARTING A NEW PROJECT ...
... can sometimes feel like reinventing the wheel.
![Page 36: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/36.jpg)
YOU ARE HERE
![Page 37: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/37.jpg)
ARCHETYPESarchetype |ˈɑːkɪtʌɪp|
noun
a very typical example of a certain person or thing: he wasthe archetype of the old-style football club chairman.an original which has been imitated; a prototype: aninstrument which was the archetype of the early flute.
![Page 38: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/38.jpg)
MAVEN ARCHETYPESA prototype upon which others are
copied, patterned, or emulated.
![Page 39: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/39.jpg)
WHAT CQ ARCHETYPES ARE THERE?simple-content-package
Generates a simple
multimodule-content-packageIncludes the folder structure for developing a CQ
application (content package and bundle).
cqblueprints multi-moduleThird-party archetype encapsulating best practices for
working with e.g. OSGi bundles, taglibs, and CQ content
See also:
content package
How to work with packages
![Page 40: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/40.jpg)
ON PACKAGESPackages enable the importing and exporting of repositorycontent. They are used to install new functionality, transfercontent between instances, or back up the repositoryA package is a zip file in file system (vault) serializationformatPackages include meta information - filter definitions,import configuration, package propertiesPackages are often managed through the CQ Package Manager
![Page 41: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/41.jpg)
ON BUNDLESBundles are modular containers of functionality for OSGi –
essentially a java module that contains application logic
Bundles consist of java classes and other resources needed
to deliver functionality or to provide services to other
bundles.
Bundles can be managed through the CQ
See also:
Web Console
Creating OSGi bundles using CRXDE
![Page 42: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/42.jpg)
HOW TO USE AN ARCHETYPE
archetypeGroupId: identifies the archetype projectuniquely across all projectsarchetypeArtifactId: the name of the archetype jarwithout a version numberarchetypeRepository: where to get the archetype from(based on pluginRepository in settings.xml)
See also: and
mvn archetype:generate -DarchetypeGroupId=foo -DarchetypeArtifactId=bar -DarchetypeVersion=1.0.0 -DarchetypeRepository=baz
Maven: Introduction to Archetypes Maven: Naming conventions
![Page 43: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/43.jpg)
SIMPLE CONTENT PACKAGE ARCHETYPEFrom the fine manual:
“Creates a maven project that is suitable for
installing resources for a simple CQ
application. The folder structure is that used
below the /apps folder of the CQ repository.
The POM defines commands for packaging
the resources that you place in the folders and
installing the packages on the CQ server.”
![Page 44: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/44.jpg)
SIMPLE CONTENT PACKAGE USAGE
archetypeGroupId: com.day.jcr.vaultidentifies the archetype project uniquely across all projectsarchetypeArtifactId: simple-content-package-archetypethe name of the archetype jar without a version numberarchetypeRepository: adobe-public-releaseswhere to get the archetype from (based onpluginRepository in settings.xml)
mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=simple-content-package-archetype -DarchetypeVersion=1.0.1 -DarchetypeRepository=adobe-public-releases
![Page 45: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/45.jpg)
SIMPLE CONTENT PACKAGE IN ACTION
![Page 46: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/46.jpg)
SIMPLE CONTENT PACKAGE PARAMETERSgroupId: Like a package name, e.g.com.yourcompany.myprojectartifactId: name of the jar without the version, e.g.myprojectversion: accept the defaultpackage: not used in simple-content-packageappsFolderName: name of /apps/myproject, e.g. myprojectartifactName: Description in Package ManagerpackageGroup: Group in Package Manager
See also: Maven: Naming conventions
![Page 47: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/47.jpg)
SIMPLE CONTENT PACKAGE OUTPUTTemplate directoriespom.xml file
Instructions for compiling, creating bundles, deployingto CQ in packages
FileVault configuration files
![Page 48: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/48.jpg)
MULTIMODULE CONTENT PACKAGE USAGEmvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.1 -DarchetypeRepository=adobe-public-releases
![Page 49: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/49.jpg)
MULTIMODULE CONTENT PACKAGE OUTPUT${artifactId} |- pom.xml |- bundle |- pom.xml |- src |- main |- java |- ${groupId} |- SimpleDSComponent.java |- test |- java |- ${groupId} |- SimpleUnitTest.java |- content |- pom.xml |- src |- main |- content |- jcr_root |- apps |- ${appsFolderName} |- config |- install |- META-INF |- vault |- config.xml
![Page 50: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/50.jpg)
|- filter.xml |- nodetypes.cnd |- properties.xml |- definition |- .content.xml
![Page 51: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/51.jpg)
CQBLUEPRINTS MULTI-MODULE USAGEFirst add the CQ Blueprints Maven Repository to Maven'ssettings.xml, then:
archetypeGroupID: com.cqblueprints.archetypesarchetypeArtifactId: multi-modulearchetypeVersion: 1.0.5archetypeRepository: cqblueprints.plugins.releases
See also: and
mvn -P cqblueprints archetype:generate -DarchetypeGroupId=com.cqblueprints.archetypes -DarchetypeArtifactId=multi-module -DarchetypeVersion=1.0.5 -DarchetypeRepository=cqblueprints.plugins.releases
Connecting to the CQ Blueprints Repository The CQ Project Maven Archetype
![Page 52: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/52.jpg)
CQBLUEPRINTS MULTI-MODULE OUTPUT${artifactId} |- README |- pom.xml |- ${artifactId}-all |- pom.xml |- ${artifactId}-config |- ${artifactId}-content |- ${artifactId}-services |- ${artifactId}-taglib |- ${artifactId}-view
![Page 53: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/53.jpg)
WHY USE CQBLUEPRINTS MULTI-MODULE?
The cqblueprint multi-module archetype is developed by
“The things we wanted to consider with ourarchetype is to address concerns of larger
teams”
headwire.com
![Page 54: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/54.jpg)
CQBLUEPRINTS MULTIMODULE DESIGNfoo-view subproject: where css/html/js developers (frontend)do their workfoo-taglib foo-services: where java developers (backend) dotheir workfoo-config: where the configuration (runmode configs stored)foo-content: how we get initial content and site structure ontothe developer's box quicklyfoo-all: how we hand off builds to the next environment
![Page 55: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/55.jpg)
USING GIT
![Page 56: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/56.jpg)
WHY GIT?Local safety net"The internet is my backup"It's good to shareEnlightened self-interest
![Page 57: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/57.jpg)
YOU ARE HERE
![Page 58: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/58.jpg)
GIT PROJECT SETUPcd projectnamegit init
![Page 59: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/59.jpg)
GIT IGNOREEdit .gitignore, for example:
.classpath
.project
.vlt/
.settings/target/
![Page 60: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/60.jpg)
GET IT IN GITgit add *git commit -m 'Initial project version'
![Page 61: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/61.jpg)
GET IT IN GITHUB (OPTIONAL)
hub-new-repo is a shortcut for creating a repository ongithub and pushing your local repo into it
See also:
See also:
cd projectgit hub-new-repo
CLI remote github repo creation
github
![Page 62: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/62.jpg)
DEMO
![Page 63: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/63.jpg)
... TIME PASSES ...
![Page 64: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/64.jpg)
COMMIT PROJECTgit add filenamesgit commit -m "meaningful message"git push origin master
![Page 65: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/65.jpg)
(BEST) PRACTICE(S)
![Page 66: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/66.jpg)
YOU ARE HERE
![Page 67: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/67.jpg)
“the three great virtues of a programmer:laziness, impatience, and hubris”
![Page 68: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/68.jpg)
![Page 69: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/69.jpg)
BUILDING
![Page 70: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/70.jpg)
HOW CAN WE BUILD SMARTER?Create local zips and jars that you can upload:
mvn packageproduces:
Content package output: target/yourapp-content-1.0-SNAPSHOT.zipBundle output: target/testapp-bundle-1.0-SNAPSHOT.jar
![Page 71: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/71.jpg)
DEPLOYING
![Page 72: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/72.jpg)
HOW CAN WE BUILD AND DEPLOY SMARTER?Content package: mvn -PautoInstallPackageinstallBundle: mvn -PautoInstallBundle install
cqblueprints: mvn -Pauto-deploy install
![Page 73: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/73.jpg)
DEMO
![Page 74: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/74.jpg)
DEVELOPING
![Page 75: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/75.jpg)
YOU ARE HERE
![Page 76: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/76.jpg)
How do we develop in a world of maven builds and deploys
and git saves?
![Page 77: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/77.jpg)
THE FILEVAULT TOOLYou can use the FileVault tool (vlt) to check in, check out,
update and sync local content with the repository.
Install: extract crx-quickstart/opt/filevault/filevault.[tgz|zip] and add to your pathUsage: vlt --credentials admin:admin co --force http://localhost:4502/crx
See also: How to use the VLT Tool
![Page 78: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/78.jpg)
SAMPLE DEVELOPMENT WORKFLOWUse maven to build and deployInitialise vltCreate components, templates with CRXDE LiteUse vlt to copy back into local filesystemChange locallyUse vlt to copy back into the repositoryAdd to git
![Page 79: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/79.jpg)
DEMO
![Page 80: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/80.jpg)
TESTING
![Page 81: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/81.jpg)
CONTINUOUS INTEGRATION? with ,
as a with and
Jenkins Git plugin GitHub plugin
Selenium server
Cucumber for java Jenkins plugin tests in java
![Page 82: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/82.jpg)
INTEGRATION TESTING FRAMEWORK... see Lydia's talk
![Page 83: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/83.jpg)
PRODUCTION
![Page 84: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/84.jpg)
How do we move to production in a world of maven builds and
deploys and git saves?
![Page 85: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/85.jpg)
YOU ARE HERE
![Page 86: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/86.jpg)
MAVEN PROFILE FOR PRODUCTIONAdd this to pom.xml:
Deploy using this profile:
Or one-time override: mvn -Dcrx.host=another.host,crx.port=4504 -PautoInstallPackage install
See also:
<profile> <id>auto-deploy-prod</id> <properties> <crx.host>production.server.hostname</crx.host> <crx.port>4502</crx.port> </properties></profile>
mvn -PautoInstallPackage,auto-deploy-prod install
Introduction to build profiles
![Page 87: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/87.jpg)
DEPLOYMENT TESTING... see Bertrand's talk
![Page 88: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/88.jpg)
PUTTING IT ALL TOGETHER
![Page 89: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/89.jpg)
0-60 IN 5 PSEUDO LINESmvn archetype:generate
git init; git add *; git commit -m "Initial project"
mvn -PautoInstallPackage install
vlt checkout ; vlt update ; vlt commit
git add; git commit; git push
![Page 90: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/90.jpg)
![Page 91: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/91.jpg)
THANK YOU. QUESTIONS?
![Page 92: CQ Maven Methods](https://reader034.vdocument.in/reader034/viewer/2022051110/54c384084a79593a698b4576/html5/thumbnails/92.jpg)
CREDITS designed by from The Noun Project
designed by from The Noun Project designed by from The Noun Project
designed by from The Noun Project designed by from The Noun Project designed by from The Noun Project
designed by from The Noun Project designed by from The Noun Project
designed by from The Noun Project designed by from The Noun Project
designed by from The Noun Project
Light Bulb Shane David KennaQuestion Anas RamadanHard Disk Drive Eddie AlshehriTime wayne25ukSync P.J. OnoriSync Rohith M SCloud Upload Adam WhitcroftPuzzle John O'SheaQuestion Henry RyderFactory Adrijan KaravdicCrash Test Dummy Luis Prado