diff --git a/dev-tools/maven/lucene/backward-codecs/pom.xml.template b/dev-tools/maven/lucene/backward-codecs/pom.xml.template
new file mode 100644
index 00000000000..fbdd619287f
--- /dev/null
+++ b/dev-tools/maven/lucene/backward-codecs/pom.xml.template
@@ -0,0 +1,100 @@
+
+
+ 4.0.0
+
+ org.apache.lucene
+ lucene-parent
+ @version@
+ ../pom.xml
+
+ org.apache.lucene
+ lucene-backward-codecs
+ jar
+ Lucene Memory
+
+ Codecs for older versions of Lucene.
+
+
+ lucene/backward-codecs
+ ../../..
+ ${relative-top-level}/${module-directory}
+
+
+ scm:svn:${vc-anonymous-base-url}/${module-directory}
+ scm:svn:${vc-dev-base-url}/${module-directory}
+ ${vc-browse-base-url}/${module-directory}
+
+
+
+
+ org.apache.lucene
+ lucene-test-framework
+ test
+
+@lucene-backward-codecs.internal.dependencies@
+@lucene-backward-codecs.external.dependencies@
+@lucene-backward-codecs.internal.test.dependencies@
+@lucene-backward-codecs.external.test.dependencies@
+
+
+ ${module-path}/src/java
+ ${module-path}/src/test
+
+
+ ${project.build.testSourceDirectory}
+
+ **/*.java
+
+
+
+
+
+ de.thetaphi
+ forbiddenapis
+
+
+ lucene-shared-check-forbidden-apis
+ none
+
+
+ check-forbidden-apis
+
+
+ true
+
+ jdk-unsafe
+ jdk-deprecated
+ jdk-system-out
+
+
+ ${top-level}/lucene/tools/forbiddenApis/base.txt
+
+
+
+ check
+
+
+
+
+
+
+
diff --git a/dev-tools/maven/lucene/pom.xml.template b/dev-tools/maven/lucene/pom.xml.template
index 6709d3b227d..e7551c4af04 100644
--- a/dev-tools/maven/lucene/pom.xml.template
+++ b/dev-tools/maven/lucene/pom.xml.template
@@ -41,6 +41,7 @@
core
+ backward-codecs
codecs
test-framework
analysis
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 1b7a79e4448..69959dccb35 100644
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -669,7 +669,7 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, te
if project == 'lucene':
# TODO: clean this up to not be a list of modules that we must maintain
- extras = ('analysis', 'benchmark', 'classification', 'codecs', 'core', 'demo', 'docs', 'expressions', 'facet', 'grouping', 'highlighter', 'join', 'memory', 'misc', 'queries', 'queryparser', 'replicator', 'sandbox', 'spatial', 'suggest', 'test-framework', 'licenses')
+ extras = ('analysis', 'backward-codecs', 'benchmark', 'classification', 'codecs', 'core', 'demo', 'docs', 'expressions', 'facet', 'grouping', 'highlighter', 'join', 'memory', 'misc', 'queries', 'queryparser', 'replicator', 'sandbox', 'spatial', 'suggest', 'test-framework', 'licenses')
if isSrc:
extras += ('build.xml', 'common-build.xml', 'module-build.xml', 'ivy-settings.xml', 'ivy-versions.properties', 'ivy-ignore-conflicts.properties', 'version.properties', 'backwards', 'tools', 'site')
else:
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 37dd9b8855c..cb2ec69b9fe 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -85,6 +85,9 @@ Other
* LUCENE-5563: Removed sep layout: which has fallen behind on features and doesn't
perform as well as other options. (Robert Muir)
+* LUCENE-5858: Moved compatibility codecs to 'lucene-backward-codecs.jar'.
+ (Adrien Grand, Robert Muir)
+
======================= Lucene 4.11.0 ======================
New Features
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java b/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java
index 692f2f60930..3446fcd3c94 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/collation/TestCollationDocValuesField.java
@@ -41,12 +41,10 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
/**
* trivial test of CollationDocValuesField
*/
-@SuppressCodecs("Lucene3x")
public class TestCollationDocValuesField extends LuceneTestCase {
public void testBasic() throws Exception {
diff --git a/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java b/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java
index 59fdb12c550..dff883bbf44 100644
--- a/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java
+++ b/lucene/analysis/icu/src/test/org/apache/lucene/collation/TestICUCollationDocValuesField.java
@@ -38,7 +38,6 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import com.ibm.icu.text.Collator;
import com.ibm.icu.util.ULocale;
@@ -46,7 +45,6 @@ import com.ibm.icu.util.ULocale;
/**
* trivial test of ICUCollationDocValuesField
*/
-@SuppressCodecs("Lucene3x")
public class TestICUCollationDocValuesField extends LuceneTestCase {
public void testBasic() throws Exception {
diff --git a/lucene/backward-codecs/build.xml b/lucene/backward-codecs/build.xml
new file mode 100644
index 00000000000..3de2979484b
--- /dev/null
+++ b/lucene/backward-codecs/build.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ Codecs for older versions of Lucene.
+
+
+
+
+
diff --git a/lucene/backward-codecs/ivy.xml b/lucene/backward-codecs/ivy.xml
new file mode 100644
index 00000000000..6d86d6a0c6e
--- /dev/null
+++ b/lucene/backward-codecs/ivy.xml
@@ -0,0 +1,21 @@
+
+
+
+
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java
similarity index 100%
rename from lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java
diff --git a/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene41/package.html b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/package.html
similarity index 92%
rename from lucene/test-framework/src/java/org/apache/lucene/codecs/lucene41/package.html
rename to lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/package.html
index f9d00126b29..7959cc0f464 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/codecs/lucene41/package.html
+++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/package.html
@@ -20,6 +20,6 @@
-Support for testing {@link org.apache.lucene.codecs.lucene41.Lucene41Codec}.
+Lucene 4.0 file format.