Jahia CMS has recently launched its newest version – Jahia 6.5 which offers excellent open source web content management benefits. Over the next week, I’ll be writing a few blog posts about this new release. In this post, I want to share a possible configuration and environment setup for developers who want to work with the open source web CMS: Jahia 6.5. The main idea is to install Jahia 6.5 Community Edition on a windows machine that belongs to a developer and implement hot deployment.
The first step is to have all the requirements needed for the installation, so you should take a look at the “Prerequisites”. Basically you just need to be sure that you have JAVA JDK installed on your machine and then install JAHIA. During the installation you just need to follow the installation wizard and make sure that your installation directory is not the user home directory and the installation folder should not contain spaces. For example you can use the path C:\jahia65.
After installing Jahia 6.5 you can visit the url http://localhost:8080 to verify that Jahia was installed correctly. Inside the installation directory the file <installation dir>\Uninstaller\ uninstaller.jar is created, and can be used to uninstall Jahia by just double clicking on it. Other files added during the installation are the startJahia.bat and the stopJahia.bat in order to stop and start Jahia.
Jahia CMS offers developers the ability to create their own Jahia custom modules. So developers should install Maven 2 on their machines because there is a Jahia archetype that creates a Jahia mvn module project structure, ready to be customized. For Maven 2 installation please visit the Apache Maven Project.
After installing Maven, it is very important to modify the Maven configuration file in order to enable hot deployments. The configuration file is usually located on <maven installation dir>\conf\ settings.xml.
This file needs to look like this:
<settings> <servers> <server> <id>jahiaRepository</id> <username>maven</username> <privateKey>C:/putty/maven.jahia.org.private</privateKey> <!— not needed if using pageant —> </server> </servers> <localRepository>C:/Documents and Settings/Juan Pablo Albuja/.m2/repository</localRepository> <activeProfiles> <activeProfile>jahia6</activeProfile> <activeProfile>configure</activeProfile> <activeProfile>artifactory</activeProfile> </activeProfiles> <pluginGroups> <pluginGroup>org.jahia.server</pluginGroup> </pluginGroups> </settings>
Note: <localRepository> should point to your Maven 2 repository.
To create a Jahia mvn module project structure you just need to run the archetype “mvn archetype:generate -DarchetypeCatalog=http://maven.jahia.org/maven2” and choose option 3. The next configuration that you need to do in order to do hot deployments by the command “mvn package jahia:deploy”, consist of:
- Go to the folder containing the recent project generated by the archetype.
- Paste the file profiles.xml at the pom.xml file level.
- Change the configuration of it according to your needs.
The customization that you need to do in the profiles.xml file has to be with the configuration of where your Tomcat Instance and database configurations are located.
In addition, developers can use Eclipse as their IDE to develop their modules. You just need to download the latest version of Eclipse. The advantage of using Eclipse is that you can easily import the project generated by the Jahia CMS archetype. To do that after the execution of the archetype, you just need to cd where the pom.xml is and run the command:
If all goes okay, you just need to go to your Eclipse and import the mvn project.