Configure IntelliJ
IntelliJ (tested with v9, v10, and v11)
In Lucene/Solr branches/lucene_solr_X_Y/ and tags/lucene_solr_X_Y_Z (where X.Y >= 3.1), branches/branch_3x/ and trunk/, running ant idea from the command line will populate your working copy with the configuration files IntelliJ needs to be able to compile, test, and debug Lucene and Solr. To then open the code in IntelliJ IDEA, simply hit File->Open Project and Choose the directory containing the checked out source (i.e. the top level directory that contains both the lucene and solr directories.)
The project configuration will have:
An IntelliJ module for each Solr/Lucene module (Lucene and Solr core, Lucene and Solr contribs, and modules/*/ on trunk), with jar and inter-module dependencies defined.
- A JUnit test run/debug configuration defined for each module's tests, including the runtime directory and required JVM parameters. All tests run and pass. IntelliJ allows more than one of these to run simultaneously, so you can gain some test parallelism by starting up more than one at a time.
- Ant integration: from the "Run" menu, you can invoke any Ant task defined in any module's build.xml file.
After ant idea runs, it will print out instructions on how to configure the project SDK, currently this consists of setting the JDK level.
Running ant clean-idea from the command line removes all IntelliJ configuration files. If you already have an existing configuration, but want to replace it with the one provided by ant idea, it's a good idea to run ant clean-idea first.
WARNING: IntelliJ apparently uses the .idea/ directory, which is removed by ant clean-idea, to store shelved changes - do not run ant clean-idea if you have shelved any changes.
Code Style
If you use the "ant idea" target, the correct code style file will be automatically installed. But if you simply must do this yourself, use the link below. You'll have to change the file a bit for it to show up in your drop-down...
The IntelliJ anonymous code style file is here: (Intellij-Lucene-Codestyle.xml)