Procedure for setting up a development environment
  • 20 Oct 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Procedure for setting up a development environment

  • Dark
    Light
  • PDF

Article summary

This guide describes how to configure the Constellio development environment.

1. Install Git

Go to https://git-scm.com/book/fr/v2/D%C3%A9marrage-rapide-Installation-de-Git and install Git.


2. Check-out of the Git project (to be done by command line)

  1. Create a folder (Example: dev-constellio);
  2. In this folder, clone the projects using the command line: 
    1. Open the Git console and move to the directory created in step 1.
    2. Run the "git clone <URL>" command for the project: https://github.com/doculibre/constellio
  3. Copy the build.gradle.main and settings.gradle.main files from the " constellio " folder to the main folder;
  4. Rename the build.gradle.main file to build.gradle and the settings.gradle.main file to settings.gradle

3. Install gradle 3.4.1

  1. Download the "binary only" archive of Gradle 3.4.1. (https://gradle.org/releases)
  2. Unzip the zip archive.


4. Installing Solr

  1. Install JDK 8 and put in the environment variable JAVA_HOME;
  2. Take the latest version 5 in zip. (http://archive.apache.org/dist/lucene/solr/);
  3. Unzip the resulting zip archive;
  4. Replace the contents of: solr/server/solr with the content in Git: constellio/solrHome5
  5. Change the value of the headers: in solr/server/etc/jetty.xml
    <Set name="requestHeaderSize"><Property name="solr.jetty.request.header.size" default="8192"/></Set>
    BY:
    <Set name="requestHeaderSize"><Property name="solr.jetty.request.header.size" default="40960"/></Set> (or add this parameter for <Call name="addConnector"> of the Set connectors section)
  6. In a command-line console, go to Solr's bin directory, and enter "solr start";
  7. Validate that Solr works by going to  http://localhost:8983/solr/#/records.


5. Installing IntelliJ IDEA Community

  1. Download installer: https://www.jetbrains.com/idea/download/#section=windows
  2. Run the installer;
  3. Edit bin/idea.properties file, add idea.gradle.prefer.idea_test_runner=true
  4. Edit the idea.exe.vmoptions file , change -Xmx512, to -Xmz2048m
  5. Start IntelliJ;
  6. Select the theme of the interface;
  7. In choosing the starting plugins, keep the default plugins, just move on to the next step;
  8. Start using IntelliJ IDEA;
  9. In file>new, select Project from existing sources
  10. In the project creation window, select " Import project ".
  11. Select the directory of the git constellio project
  12. Select " import project from external model ", then " Gradle ".
  13. Select import options
    1. Use auto-import.
    2. Checked the option "Create separate" module per source set.
    3. Specify the installation directory for Gradle 3.4.1
    4. Gradle JVM must be a JDK 8
  14. After import make sure that the VCS is registered in IntelliJ;
  15. In File > Project Structure > Project, specify the path to the installation directory of your JDK, and configure the " Project language level " field in version 1.8;
  16. In File > Settings > Build, Execution, Deployment > Compiler > Java Compiler, configure the " Use compiler " field to " Javac ", and configure " Project bytecode version " to version 1.7;
  17. Validate that there are no compilation errors;

If error

  • compilation with import
    org.artofsolving.jodconverter.OfficeDocumentConverter
    • Copy all app libs to date libs
  • with @PluginImplementation
    • Add jspf to the classpath (choose correction proposed by intelliJ)
  • de 'java.lang.RuntimeException:constellio/sdk/sdk.properties' does not exist in project 'sdk'
    • Create the sdk.properties file in the same location as sdk.properties.all and with the same content.

6. Test rotation

The sdk.properties file (automatically created on first launch) is used to configure which tests are launched.

First launch

  • Before starting the tests: Go to Master button at the bottom right > Checkout Tag or Revision, then enter the name of the last tag (to get the last tag, go to github > tags and then look for the most recent tag, Example: 7.7.2)
  • Select constellio > sdk > Run Test in 'sdk'

If the following error appears: Command line is too long. Shorten command line for All in sdk_test or also for JUnit default configuration.

  • Click on default > Shorten command line and select " JAR manifest " then roll the tests again

7. Build the war

  1. Create a file with the name "version" in the Constellio folder;
  2. Write to the body of the file the version of Constellio (Example: 7.7.3);
  3. Go to View > Tool Windows > Gradle
  4. In Gradle, go to constellio > Tasks > build and click build.

The operation can take a long time, but the .war file is created a few minutes after the build is launched.

After it is created, the .war file is located in the constellio path > build > libs

The operation can be paused once the file is created. 


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.