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

Compare with Current View Page History

« Previous Version 40 Next »

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

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


This effort is in a very rapid state of change. Please be sure to check the JIRA above to see what the current state is regularly. In particular, we hope to merge this with master soon, so be aware of that. Due to how rapidly things are changing, this page is intentionally very sparse, we'll elaborate as the effort matures. Meanwhile, please ask questions on the mailing list etc. if you're stuck.

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

  1. Get a current version of Lucene/Solr with the usual "git clone https://github.com/apache/lucene-solr.git dest"
  2. cd dest
  3. git checkout -t origin/gradle-master
    1. NOTE: gradle-master will be merged into the mainline code soon (we hope). Check the status of LUCENE-9070 to verify we're still on the branch.
  4. ./gradlew :help


  • 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 deleted 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