- Print
- DarkLight
- PDF
Procedure for setting up a development environment
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)
- Create a folder (Example: dev-constellio);
- In this folder, clone the projects using the command line:
- Open the Git console and move to the directory created in step 1.
- Run the "git clone <URL>" command for the project: https://github.com/doculibre/constellio
- Copy the build.gradle.main and settings.gradle.main files from the " constellio " folder to the main folder;
- Rename the build.gradle.main file to build.gradle and the settings.gradle.main file to settings.gradle.
3. Install gradle 3.4.1
- Download the "binary only" archive of Gradle 3.4.1. (https://gradle.org/releases)
- Unzip the zip archive.
4. Installing Solr
- Install JDK 8 and put in the environment variable JAVA_HOME;
- Take the latest version 5 in zip. (http://archive.apache.org/dist/lucene/solr/);
- Unzip the resulting zip archive;
- Replace the contents of: solr/server/solr with the content in Git: constellio/solrHome5
- 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) - In a command-line console, go to Solr's bin directory, and enter "solr start";
- Validate that Solr works by going to http://localhost:8983/solr/#/records.
5. Installing IntelliJ IDEA Community
- Download installer: https://www.jetbrains.com/idea/download/#section=windows
- Run the installer;
- Edit bin/idea.properties file, add idea.gradle.prefer.idea_test_runner=true
- Edit the idea.exe.vmoptions file , change -Xmx512, to -Xmz2048m
- Start IntelliJ;
- Select the theme of the interface;
- In choosing the starting plugins, keep the default plugins, just move on to the next step;
- Start using IntelliJ IDEA;
- In file>new, select Project from existing sources
- In the project creation window, select " Import project ".
- Select the directory of the git constellio project
- Select " import project from external model ", then " Gradle ".
- Select import options
- Use auto-import.
- Checked the option "Create separate" module per source set.
- Specify the installation directory for Gradle 3.4.1
- Gradle JVM must be a JDK 8
- After import make sure that the VCS is registered in IntelliJ;
- 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;
- 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;
- 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
- Create a file with the name "version" in the Constellio folder;
- Write to the body of the file the version of Constellio (Example: 7.7.3);
- Go to View > Tool Windows > Gradle
- 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.