Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Took out IDE section.

...

Though this leaves added files, which must be removed

Helpful Resources

The following resources may prove helpful when developing Solr contributions. (These are not an endorsement of any specific development tools, but Eclipse and IntelliJ seem to be the most popular)

  • Eclipse (Eclipse codestyle).
  • IntelliJ (IntelliJ codestyle) NOTE: there is no need to install this file separately if you execute "ant idea" or "gradlew idea", it is done for you. If you do install it, you'll have to tweak the name to select in in IntelliJ as it's currently anonymous (all the more reason to use the target, see the IntelliJ instructions).

Development Environment Tips

Here is a guide for setting up Eclipse, IntelliJ and Netbeans dev environments:

Follow the instructions above to fetch the combined Lucene and SOLR trunk. For the remainder of this document, the installation path is assumed to be ~/apache/trunk/lucene and ~/apache/trunk/solr. NOTE: I'm installing on a Macbook, so this is a *nix style file system etc. These instructions should work for windows as well, but if you try to use them in that environment, feel free to update this page with anything you uncover.

Before fiddling with the IDE, I'd strongly recommend you get the tests to run from the shell. This will insure that your machine has the proper setup for the IDEs to magically find what's necessary. See the instructions above. Hint: Issue 'gradlew check' or 'ant clean test' in the SOLR and Lucene directories and look for "BUILD SUCCESSFUL" minutes later.

Setting things up is actually very smooth when it's smooth, especially if the tests have run <G>.

DO NOT BE SURPRISED IF SOME TESTS FAIL IN THE IDE. There are some anomalies when running Junit tests for these projects in an IDE. Some of them are already cleaned up, but others may still fail when run in an IDE. The definitive case for whether a test fails or not is running it as a Gradle or Ant test.

Eclipse

See wiki page on configuring Eclipse.

IntelliJ (9.X-14.X)

See the Lucene wiki page on configuring IntelliJ - it also covers Solr configuration.

Netbeans

See the Lucene wiki page on configuring Netbeans.

Maven

IDE integration

Both Intellij and Eclipse are supported out of the box.

For Lucene/Solr 9x and later, executing "gradlew tasks" will list a section "IDE tasks" to get you started. The lucene dev user's list or the slack solr-dev channel are good places for detailed questions.

For Lucene/Solr 8x and earlier, "ant idea" and "ant eclipse" will create the project structure that can then be opened.There is information about using Maven with Solr and Lucene in the source tree, at dev-tools/maven/README.maven. The information differs slightly by code branch. Here is a link to this file for the trunk version (unreleased; will be released as version 6.0 as of this writing): https://git1-us-west.apache.org/repos/asf?p=lucene-solr.git;a=blob;f=dev-tools/maven/README.maven;h=390177172cd2fee2639e83d2cf4900bea1e8d05f;hb=refs/heads/master

Getting your feet wet: where to begin?

...