lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Solr Wiki] Update of "HowToContribute" by RobertMuir
Date Tue, 20 Mar 2012 09:51:27 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "HowToContribute" page has been changed by RobertMuir:

break out eclipse configuration into its own wikipage. HowToContribute is too overwhelming
(yep, thats a bad thing)

   * New unit tests should be provided to demonstrate bugs and fixes (
  == Notes for Eclipse and the New Merged Lucene/Solr checkout ==
- Another issue you may see is character encoding, especially if you are including the lucene/contrib/analyzers
package. On Eclipse, you can solve this by going to Project > Properties > Resources,
and then changing the encoding on that page to UTF-8. Then let Eclipse rebuild the workspace
(either automatically if you have that checked, or force a rebuild) and you should be golden!
+ To get correct classpath, formatting, encoding, and project settings in Eclipse, simply
run {{{ant eclipse}}} and then reload the project in Eclipse.  Make sure you are using Java
- (thanks to Mark Miller and Erik Hatcher for contributing to this)
- To get correct classpath and project setting in Eclipse, simply run {{{ant eclipse}}} and
then reload the project in Eclipse.  Make sure you are using Java 1.6, otherwise you may get
"inconsistent hierarchy" error messages for some of the test classes.
  == Generating a patch ==
  A "patch file" is the format that all good contributions come in.  It bundles up everything
that is being added, removed, or changed in your contribution.
@@ -198, +195 @@

  Setting things up is actually very smooth when it's smooth, especially if the tests have
run <G>.
- == Eclipse (Galileo, J2EE version, but any relatively recent Eclipse
should do): ==
- Checkout the trunk with subclipse (location:,
then run 'ant eclipse' and refresh your project.
  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 an Ant task.
+ == Eclipse ==
+ See [[|wiki page on configuring Eclipse]].
- === Enabling Assertions for unit tests in Eclipse ===
- By default, Eclipse does not run test with assertions enabled. This causes some tests to
run incorrectly in Eclipse and excludes some checks in the source code.
- Change this by checking the box "Add '-ea' to VM arguments when creating a new JUnit launch
- This checkbox is available under Windows>Preferences>Java>JUnit
- === Installing the code style file ===
- Lucene and SOLR have a common code style preferences. Install one in your Eclipse and set
it as the default for the project. Do this by:
-  * Getting the Eclipse code style xml files ([[|link]]).
-  * In Eclipse, click "Project>>Properties". In the dialog box, click "Java code style>>Formatter".
Up in the upper right of the dialog box that comes, click "Configure Workspace Settings".
NOTE: you can do this on an individual project basis if you prefer.
- You should now be able to click the "import" button, and import the codestyle file you downloaded.
Eclipse doesn't immediately show that the selected import is the new code style, but closing
the dialog boxes and coming back to the formatter page should allow you to choose it.
- Tips:
-  * For importing code style xml in Eclipse Helios go to Window > Preferences > Java
> Code Style > Formatter, Import to import the file.
-  * Under some conditions, I've seen this process have thousands of compile  errors, something
like "class XXX defined in multiple places". This went  away when I highlighted the project
and clicked "refresh".
-  * Think about installing the subclipse plugin, it'll allow you to update your source from
within Eclipse. See:
-  * You can create patches for the committers to apply from within the IDE easily.
-  * By and large, you won't "run" a Lucene program, you'll really run unit tests. (Others,
please chime in here!!!). The general development cycle for Lucene is to add functionality,
add unit tests, make sure all unit tests run and check in (actually, submit a patch to check
in, preferably attached to a JIRA issue). There's no "program" that you start up in your IDE
to test changes, just use unit tests.
- Running SOLR in Eclipse: See:
- == Eclipse (using Git) ==
- Work has begun to maintain a Git repository with project settings. It allows a simple "File
-> Import... -> Projects from Git" workflow using EGit (version >= 0.9). Currently
it's a single Eclipse project compiling Lucene and Solr without errors. It's likely better
to have separate projects for proper dependency management. Please contribute!
- The repository is available on GitHub (git:// It
can be easily kept in sync with Apache SVN using the Lucene & Solr Git mirror.
  == IntelliJ (9.0.X and 10.X) ==
  See [[|the Lucene wiki page on
configuring IntelliJ]] - it also covers Solr configuration.

View raw message