Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 2.65 KB

solr-source-code.adoc

File metadata and controls

50 lines (34 loc) · 2.65 KB

Working With Solr Source Code

Building Solr from Source

Download the Java 11 JDK (Java Development Kit) or later. We recommend the OpenJDK distribution Eclipse Temurin available from https://adoptium.net/. You will need the JDK installed, and the $JAVA_HOME/bin (Windows: %JAVA_HOME%\bin) folder included on your command path. To test this, issue a "java -version" command from your shell (command prompt) and verify that the Java version is 11 or later. See the JVM developer doc for more information on Gradle and JVMs.

Clone the latest Apache Solr source code directly from the Git repository: https://solr.apache.org/community.html#version-control. Alternatively, you can download the Apache Solr distribution, from https://solr.apache.org/downloads.html and unzip the distribution to a folder of your choice, e.g. C:\solr or ~/solr.

Solr uses Gradle as the build system. Navigate to the root of your source tree folder and issue the ./gradlew tasks command to see the available options for building, testing, and packaging Solr.

./gradlew dev will create a Solr executable suitable for development. cd to ./solr/packaging/build/dev and run the bin/solr script to start Solr.

Note
gradlew is the "Gradle Wrapper" and will automatically download and start using the correct version of Gradle for Solr.
Note
./gradlew help will print a list of high-level tasks. There are also a number of plain-text files in <source folder root>/help.

The first time you run Gradle, it will create a file "gradle.properties" that contains machine-specific settings. Normally you can use this file as-is, but it can be modified if necessary.

Note as well that the gradle build does not create or copy binaries throughout the source repository so you need to switch to the packaging output folder ./solr/packaging/build; the rest of the instructions below remain identical. The packaging directory is rewritten on each build.

If you want to build the documentation, type ./gradlew -p solr documentation.

./gradlew check will assemble Solr and run all validation tasks unit tests.

Note
the check command requires perl and python3 to be present on your PATH to validate documentation.

To build the final Solr artifacts run ./gradlew assemble.

Lastly, there is developer oriented documentation in ./dev-docs/README.adoc that you may find useful in working with Solr.

Additional Information

You can review the contribution guide for information on how to contribute. There are also additional helpful docs in the help directory.