Showing posts with label Node Js. Show all posts
Showing posts with label Node Js. Show all posts

Friday, 17 February 2017

Using Grunt in an AEM Maven build

This post is a guide on how to establish a functional Maven build for AEM that includes Bower front-end dependency management and Grunt task management. The Grunt build will download Bower dependencies, move them to a client library, then create their respective .content.xml, css.txt, and js.txt to be used at the AEM component level.
Prerequisites for this post:
  • AEM instance (requires Java SDK)
  • Maven (Link)
  • NodeJS w/ npm (Link)
  • Grunt (Link)
  • Bower (Link)
  • Optional reference file packet (Link)
After installing above dependencies, set up a mvn project using the below code in a terminal or command prompt: mvn archetype:generate -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2 -DgroupId=my-group-id -DartifactId=gruntproject -Dversion=1.0-SNAPSHOT -Dpackage=com.grunt.gruntproject -DappsFolderName=gruntproject -DartifactName="Grunt Project" -DcqVersion="5.6.1" -DpackageGroup="Grunt"