Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.VERSION.swp
.build.gradle.swp
.gradle
.iml
build/
gradle.properties
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ In order to use this project's templates, you must first have lazybones installe

You can also download the distribution package from [BinTray](https://bintray.com/pledbrook/lazybones-templates/lazybones), unzip it, and add it to your PATH.

This project currently contains two templates:

# [Multimodule Template](#using-the-multimodule-template) - A fully-featured template for AEM projects
# [Simple Multimodule Template](#using-the-simple-multimodule-template) - A pared-down template for an empty bundle and content package project.

# Using the Multimodule Template

Once Lazybones is installed, you can run Lazybones passing in the correct template name:
To run:

lazybones create aem-multimodule-project <directory name>

Expand All @@ -43,10 +48,10 @@ Below are all of the options available in the current version. To specify an opt
| Project Name | My AEM Project | projectName |
| Group name for Content Package | my-packages | packageGroup |
| Target AEM Version | 6.2 | aemVersion |
| Folder to create under `/apps` | my-aem-project | appsFolderName |
| Folder to use under `/content` | my-aem-project | contentFolderName |
| Folder to create under `/apps` | my-aem-project | appsFolderName |
| Folder to use under `/content` | my-aem-project | contentFolderName |
| Create AEM 6.2 Editable Templates folders? | yes | createEditableTemplatesStructure |
| Folder to create under `/conf` | my-aem-project | confFolderName |
| Folder to create under `/conf` | my-aem-project | confFolderName |
| Create a site design? | yes | createDesign |
| Design folder name | my-aem-project | designFolderName |
| Create a main client library? | yes | createMainClientLib |
Expand All @@ -55,7 +60,7 @@ Below are all of the options available in the current version. To specify an opt
| Create Environment-Specific Config Folders? | yes | createRunModeConfigFolders |
| Environment Names | localdev,dev,qa,stage,prod | envNames |
| Create Author and Publish Config Folders per Environment? | yes | createAuthorAndPublishPerEnv |
| Set root mapping to `/welcome` (Classic UI)? | yes in 5.6.1, no in 6.0 | reconfigureRootMapping |
| Set root mapping to `/welcome` (Classic UI)? | yes in 5.6.1, no in 6.0 | reconfigureRootMapping |
| Set Default Authoring UI to Classic? (6.0 only) | yes | enableClassicAuthoringAsDefault |
| Include ACS AEM Commons? | yes | includeAcsAemCommons |
| Include ACS AEM Commons as a sub-package? | yes | includeAcsAemCommonsSubPackage |
Expand All @@ -72,6 +77,31 @@ Below are all of the options available in the current version. To specify an opt
| Purge DAM Workflows? | yes | purgeDamWorkflows |
| DAM Workflow Retention Period (days) | 7 | purgeDamWorkflowRetention |

# Using the Simple Multimodule Template

To run:

lazybones create aem-simple-multimodule-project <directory name>

For example, to create a new project in the directory `my-project`, run

lazybones create aem-simple-multimodule-project my-project

This will prompt you to answer a number of questions about the project you want created.

## Options

Below are all of the options available in the current version. To specify an option on the command line, pass -P\<parameter name>=\<parameter value>

| Description | Default | Parameter Name |
|-----------------------------------------------------------|------------------------------------|--------------------------------|
| Maven Group ID | com.myco | groupId |
| Maven Artifact ID | example-project | artifactId |
| Project Name | My AEM Project | projectName |
| Group name for Content Package | my-packages | packageGroup |
| Target AEM Version | 6.2 | aemVersion |
| Folder to create under `/apps` | my-aem-project | appsFolderName |

# Links to ACS AEM Commons Features

Several of the prompts ask if you want to enable specific [ACS AEM Commons](http://adobe-consulting-services.github.io/acs-aem-commons/) features. Links to the feature documentation can be found below:
Expand Down
26 changes: 26 additions & 0 deletions templates/aem-simple-multimodule-project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ${projectName}

This a content package project generated using the AEM Simple Multimodule Lazybones template.

## Building

This project uses Maven for building. Common commands:

From the root directory, run ``mvn -PautoInstallPackage clean install`` to build the bundle and content package and install to a CQ instance.

From the bundle directory, run ``mvn -PautoInstallBundle clean install`` to build *just* the bundle and install to a CQ instance.

## Using with VLT

To use vlt with this project, first build and install the package to your local CQ instance as described above. Then cd to `content/src/main/content/jcr_root` and run

vlt --credentials admin:admin checkout -f ../META-INF/vault/filter.xml --force http://localhost:4502/crx

Once the working copy is created, you can use the normal ``vlt up`` and ``vlt ci`` commands.

## Specifying CRX Host/Port

The CRX host and port can be specified on the command line with:
mvn -Dcrx.host=otherhost -Dcrx.port=5502 <goals>


1 change: 1 addition & 0 deletions templates/aem-simple-multimodule-project/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1-SNAPSHOT
112 changes: 112 additions & 0 deletions templates/aem-simple-multimodule-project/core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
<modelVersion>4.0.0</modelVersion>
<!-- ====================================================================== -->
<!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<parent>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
<!-- P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->

<artifactId>${artifactId}-bundle</artifactId>
<packaging>bundle</packaging>
<name>${projectName} Bundle</name>

<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
</dependency>
<dependency>
<groupId>biz.aQute</groupId>
<artifactId>bndlib</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
</dependency>
</dependencies>

<!-- ====================================================================== -->
<!-- B U I L D D E F I N I T I O N -->
<!-- ====================================================================== -->
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<executions>
<execution>
<id>generate-scr-descriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${groupId}.${artifactId}-bundle</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<configuration>
<slingUrl>http://\${crx.host}:\${crx.port}/apps/${appsFolderName}/install</slingUrl>
<usePut>true</usePut>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<excludePackageNames>
*.impl
</excludePackageNames>
</configuration>
</plugin>
</plugins>
</build>
</project>
59 changes: 59 additions & 0 deletions templates/aem-simple-multimodule-project/lazybones.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import uk.co.cacoethes.util.NameType
import org.apache.commons.io.FileUtils

def askFromList(String message, String defaultValue, String propertyName, options) {
String fullMessage = "${message} Choices are ${options}: "
String val = ""
while (!options.contains(val)) {
val = ask(fullMessage, defaultValue, propertyName)
}
return val
}

def writeToFile(File dir, String fileName, String content) {
FileUtils.write(new File(dir, fileName), content, fileEncoding)
}

def rename(src, dest){
def folder = new File(projectDir, src)
folder.renameTo (new File(projectDir, dest))
return dest
}

def VERSION_62 = "6.2"
def VERSION_63 = "6.3"

def props = [:]

props.groupId = ask("Maven group ID for the generated project [com.myco.group]: ", "com.myco.group", "groupId")
props.artifactId = ask("Maven artifact ID for the generated reactor project [myco-project]: ", "myco-project", "artifactId")
props.projectName = ask("Human readable project name [My AEM Project]: ", "My AEM Project", "projectName")
props.packageGroup = ask("Group name for Content Package [my-packages]: ", "my-packages", "packageGroup")
props.aemVersion = askFromList("Target AEM version [${VERSION_63}]: ", VERSION_62, "aemVersion", [VERSION_62, VERSION_63])

def defaultFolderName = transformText(props.projectName, from: NameType.NATURAL, to: NameType.HYPHENATED).toLowerCase()
props.appsFolderName = ask("Folder name under /apps for extensions [${defaultFolderName}]: ", defaultFolderName, "appsFolderName")

if (props.aemVersion == VERSION_62) {
props.apiDependency = "6.2.0"
}else if (props.aemVersion == VERSION_63) {
props.apiDependency = "6.3.0"
}

println "Processing README..."
processTemplates "README.md", props

println "Processing pom files..."
processTemplates "**/pom.xml", props

println "Processing package metafiles..."
processTemplates "ui.apps/src/main/content/META-INF/vault/properties.xml", props
processTemplates "ui.apps/src/main/content/META-INF/vault/filter.xml", props
processTemplates "ui.apps/src/main/content/META-INF/vault/definition/.content.xml", props

def contentFolderDir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}")
contentFolderDir.mkdirs()

def installDir = new File(projectDir, "ui.apps/src/main/content/jcr_root/apps/${props.appsFolderName}/install")
installDir.mkdirs()
writeToFile(installDir, ".vltignore", "*.jar")
Loading