We setup local development environment to work on AEM development projects. In this tutorial, I will explain how to setup development environment with intelliJ IDE and adobe repo on Windows. After set environment you can push app and content changes directly to AEM from intelliJ and also pull changes from AEM to intelliJ.
Install Cygwin
To setup this local environment, we need to install cygwin. This is free tool to run bash on window. Go to https://www.cygwin.com/ . Download and execute installer setup-x86-64.exe. While installing this make sure you select zip, unzip, rsync and curl packages on package window. To choose these package select version instead of skip. To find these package choose "Full" in View dropdown on top left.
Once you install, add cygwin path to environment path variable. ex. "C:\cygwin64\bin"
Install/Download repo
Download repo from adobe git repo and kept it at some drive ex . "C:\tools-repo\repo" You don't need to install this. This is single file download and keep at some folder as mention above.
Create configuration in intellij
Now create external tool configuration in intellij for commands.
1. Import project in intellij as maven project.
2. create a text file .repo in project code at parent. Add server and credentials to this file. These are default values. You can change as per your AEM environment. You can set one AEM instance at a time. Add below entry to .repo.
server="http://localhost:4502"
credentials="admin:admin"
Create configuration in intellij.
1. Go to File -> settings -> Tools -> External Tools -> click + sign to create config. one window will open. Add below entries. This will push your changes to AEM on selected path.
Name = repo(put) { Any name can be added here. }
Group = repo {Anything could be added here. but make sure you add same group to all commands }
Program = C:\cygwin64\bin\bash.exe {fixed, as per your cygwin install directory}
Arguments = -l C:\tools-repo\repo put -f $FilePath$ {fixed, repo path is where you kept repo file}
2. Go to File -> settings -> Tools -> External Tools -> click + againto create config. one window will open. Add below entries. This will pull/get your changes from AEM on selected path.
Name = repo(get) { Any name can be added here. }
Group = repo {Anything could be added here. but make sure you add same group to all commands }
Program = C:\cygwin64\bin\bash.exe {fixed, as per your cygwin install directory}
Arguments = -l C:\tools-repo\repo get -f $FilePath$ {fixed, repo path is where you kept repo file}
3. Go to File -> settings -> Tools -> External Tools -> click + againto create config. one window will open. Add below entries. This will show local status of changes.
Name = repo(status) { Any name can be added here. }
Group = repo {Anything could be added here. but make sure you add same group to all commands }
Program = C:\cygwin64\bin\bash.exe {fixed, as per your cygwin install directory}
Arguments = -l C:\tools-repo\repo st -f $FilePath$ {fixed, repo path is where you kept repo file}
4. Go to File -> settings -> Tools -> External Tools -> click + againto create config. one window will open. Add below entries. This will show difference between AEM and intellij on selected folder.
Name = repo(diff) { Any name can be added here. }
Group = repo {Anything could be added here. but make sure you add same group to all commands }
Program = C:\cygwin64\bin\bash.exe {fixed, as per your cygwin install directory}
Arguments = -l C:\tools-repo\repo diff -f $FilePath$ {fixed, repo path is where you kept repo file}
To work with these commands.
1. Right click on folder (ex. src/main/content/jcr_root/apps/aemgeeks)
2. At bottom of popup menu, you will see repo option.
3. By hovering repo, you will find all four configuration.
4. Click on required configuration to perform required task.
I hope this will help you. This is good tool and will make your development very easy.
If you need to understand more over AEM 6.5 project. please follow below videos.
Create AEM project using Maven Archetype 23.
How to import AEM project in intellij and deploy bundle and package from intellij without any manuall steps.
Setup loacl AEM development using intellij and repo on Mac.
