Lucene 2.1 can read index files created with previous releases, but will write new files in the 2.1 version. Once you upgrade to 2.1 you cannot go back anymore, unless you re-index the repository.
Because lucene 2.1 is not yet available in a maven 2 repository and the change is only minor I would rather keep the 2.0 compile dependency in the pom. I suggest the following change:
— PersistentIndex.java (revision 520911)
+++ PersistentIndex.java (working copy)
@@ -42,7 +42,7 @@
private static final String WRITE_LOCK = IndexWriter.WRITE_LOCK_NAME;
/** Name of the commit lock file */
- private static final String COMMIT_LOCK = IndexWriter.COMMIT_LOCK_NAME;
+ private static final String COMMIT_LOCK = "commit.lock";
/** The name of this persistent index */
private final String name;
This allows the sources to compile with either 2.0 or 2.1.
I think it is actually possible to upgrade lucene without this change because the compiler puts the commit.lock literal into the PersistentIndex class file and therefore removes the dependency to the IndexWriter.COMMIT_LOCK_NAME field.