Search in the Documentation:

Using the Maven archetype

In order to create a new template set using our provided Maven archetype, please follow the steps below:

  • Open a new command windows or a console and go under your template development directory. Then execute the following Maven goal:

mvn archetype:generate -DarchetypeCatalog=http://maven.jahia.org/maven2

  • Choose archetype 5, jahia-templatesSet-archetype (Jahia archetype for creating a new templates set (for Jahia version >= 6.5))
  • artifactId = “templates-mytTpl”
  • jahiaPackageVersion = “6.5”
  • moduleName = “templates-myTpl”
  • Validate with “Y”

The Maven architecture of your template set project is created.

[image]

The maven architecture of the template project is the following:

	.
	|-- pom.xml
	`-- src
	|-- main
	| |-- assembly
	| | `-- src.xml
	| |-- import
	| | `-- repository.xml
	| |-- java
	| |-- resources
	| | `-- META-INF
	| | `-- templates-mytTpl.tld.disabled
	| `-- webapp
	| |-- META-INF
	| | |-- definitions.cnd
	| | `-- spring
	| | `-- templates-mytTpl.xml.disabled
	| |-- css
	|
	| |-- icons
	| |-- img
	| |-- javascript
	| |-- resources
	| | `-- __resourceBundleName__.properties
	| |-- rules.drl.disabled
	| `-- scripts
	`-- site
	|-- apt
	| `-- index.apt
	`-- site.xml

Your template set created, you can now deploy it to your Jahia server with Maven using the following command:

mvn jahia:deploy