Developing from Source - Documentation topics on: development,eclipse,eclipse plugins,installation,intellij,setting up a development environment in eclipse,.

This documentation is a static copy for this version. For current documentation, see: http://dotcms.com/docs/latest

Developing from Source

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 CommandTaskNotes
./gradlew jarBuild dotCMS WAR file
./gradlew deployWarTomcatCompile Core project
  • Deploys in the tomcat8 folder.
  • assets and dotsecure folders are deleted.
  • Takes the ee.jar from the dotCMS artifactory repository.
./gradlew deployWarTomcatBackupCompile Core project, preserving assets
  • Deploys in the tomcat8 folder.
  • assets and dotsecure folders are not deleted.
  • Takes the ee.jar from the dotCMS artifactory repository.
./gradlew deployWarTomcatTestsCompile Core project for testing
  • Deploys in the tomcat8 folder.
  • assets and dotsecure folders are deleted.
  • Takes the ee.jar from the dotCMS artifactory repository.
  • Deploys test classes in tomcat.
./gradlew deployWarTomcatDevCompile Core and ee projectsThis task is for dotCMS internal use only, since it compiles code for the ee.jar which is not available in the public dotCMS repo.
  • Deploys in the tomcat8 folder.
  • assets and dotsecure folders are deleted.
  • Compiles the enterprise project and deploys a non-obfuscated ee.jar.
./gradlew createDistCreate Distributione.g. .tar.gz, .zip files
./gradlew deployPluginsDeploy plugins
./gradlew undeployPluginsUndeploy 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.