You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 41 Next »

Let's try out the new Lucene/Solr Gradle build!

Mark Miller spearheaded this effort. The current progress is being tracked at LUCENE-9077: Gradle build, which Dawid Weiss is guiding. All help welcome! Please coordinate with others on that JIRA so as to keep from duplicating effort.

Here's how you can get started as of early December, 2019:

  1. Install Gradle, see: https://docs.gradle.org/current/userguide/installation.html
  2. Get a current version of Lucene/Solr with the usual "git clone https://github.com/apache/lucene-solr.git dest"
  3. cd dest
  4. ./gradlew help
  5. ./gradlew helpAnt - this will give you the Gradle commands to use to do operations you already know how to do in Ant.


  • For those who want to start Solr with bin/solr, the "assemble" task is what you want.
  • Mark recommends using https://github.com/dougborg/gdub as this lets you run targets from submodules rather than having to do everything top level with gradlew.
    Where you might normally do ./gradlew solr:core:test from the root directory, gdub lets you do cd solr/core; gw test. This is not necessary, but may be convenient

Using both Ant and Gradle

Until we are confident we can use Gradle exclusively, we need to be able to use both Gradle and Ant builds. So far you can switch back and forth seamlessly. We encourage anyone interested to try to use the gradle build system and note any tasks that are unavailable/incomplete. Even better help make the process more complete. Please be sure to check that someone else hasn't already started the effort though!

Useful tip when switching back and forth: try "git clean -d -x -f" between times. WARNING: this deletes everything from you machine not known to Git, so it's pretty draconian. This can be particularly useful when switching between "ant precommit" and "gradlew check -x test".




  • No labels