There are different ways to set up dotCMS to run in debug mode, which allows you to hot swap class and code changes (for the most part). You can run dotCMS standalone, from release, and connect to it via remote debugging as described in other documents, or you can run from Eclipse/IntelliJ in debug mode. Either way is effective.
dotCMS Source Installation from Command Line
Inside Eclipse
Inside IntelliJ
Logging into your dotCMS installation
New Gradle Tasks and Additional Information
From the Command Line
1. Clone the dotCMS core repository using the following command (make sure the “–recursive” option is being passed down):
git clone --recursive git@github.com:dotCMS/core.git
2. In case you have access to enterprise and license repositories, execute:
git submodule update --remote
This command will connect the submodules inside “core” with the correct repositories.
3. Open up a terminal and run the following command from core/dotCMS
:
./gradlew clean deployWarTomcatTests
Setup environment to work with Eclipse (or move to Inside IntelliJ)
This will make sure the dependencies are downloaded correctly and your project compiles correctly.
4. Clean any Eclipse configuration, if any by running this command from core/dotCMS
(this step is optional)
./gradlew cleanEclipse
5. Run the eclipse plugin tasks to configure .project, .classpath and .factorypath from core/dotCMS
./gradlew eclipse
6. Open Eclipse and import the project - choose the core/dotCMS
directory.
7. Select “Existing project into Workspace”
Inside IntelliJ
This doc assumes you have followed the from Command Line dotCMS installation steps 1-3* *
4. Click on “Import Project”
5. Select build.gradle file from dotCMS path
6. Specify any additional settings if you wish and click OK
7. Set a “Test Resource” path
Go to File → Project Structure → Modules → dotCMS → dotCMS_functionalTest and set src/functional-test/java folder as Test Source, as well as src/functional-test/resources as Test Resource. Then click Apply and OK.
8. Do the same with dotCMS_integrationTest module.
Logging into your dotCMS installation
In a browser, go to
http://127.0.0.1:8080/
the css will compile and the site should render
In another browser tab, go to
http://localhost:8080/dotAdmin
login with:
- User: admin@dotcms.com
- Password: admin
Note: using 127.0.0.1 for front end traffic will allow you to login at localhost:8080/dotAdmin under a different session. You can also use your browser in incognito mode for the same effect.
Additional Information
The following additional information may be helpful when working with a dotCMS source distribution.
Gradle Tasks
The following gradle commands are used to perform the specified tasks when developing from source:
Gradle Command | Task | Notes |
---|---|---|
./gradlew jar | Build dotCMS WAR file | |
./gradlew deployWarTomcat | Compile Core project |
|
./gradlew deployWarTomcatBackup | Compile Core project, preserving assets |
|
./gradlew deployWarTomcatTests | Compile Core project for testing |
|
./gradlew deployWarTomcatDev | Compile Core and ee projects | This task is for dotCMS internal use only, since it compiles code for the ee.jar which is not available in the public dotCMS repo.
|
./gradlew createDist | Create Distribution | e.g. .tar.gz, .zip files |
./gradlew deployPlugins | Deploy plugins | |
./gradlew undeployPlugins | Undeploy plugins |
Note: Under the regular dotCMS distribution the deploy-plugins.sh and the undeploy-plugins.sh must be used to deploy/undeploy plugins; the above gradle commands are only used when developing from source.
Important Paths
- [Gradle tasks](#GradleTasks} must be run from the core/dotCMS folder.
- WAR files generated by the
gradlew jar
command are generated in the folder. - Distribution files (e.g.
.tar.gz
and.zip
files) are generated in the core/dist-output folder.