Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-6306

upgrade uses lucene wrong version (transient dependency)

    XMLWordPrintableJSON

Details

    Description

      While trying to perform the release of 1.7.1 I stumbled upon javadoc errors not finding artifacts

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:aggregate (aggregate) on project jackrabbit-oak: An error has occurred in JavaDocs report generation: 
      [ERROR] Exit code: 1 - javadoc: warning - Multiple sources of package comments found for package "org.osgi.service.component"
      [ERROR] javadoc: warning - Multiple sources of package comments found for package "org.osgi.util.tracker"
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:139: error: cannot find symbol
      [ERROR] import org.apache.lucene.index.TermDocs;
      [ERROR]                               ^
      [ERROR]   symbol:   class TermDocs
      [ERROR]   location: package org.apache.lucene.index
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:140: error: cannot find symbol
      [ERROR] import org.apache.lucene.index.TermEnum;
      [ERROR]                               ^
      [ERROR]   symbol:   class TermEnum
      [ERROR]   location: package org.apache.lucene.index
      

      A deeper investigation highlighted that oak-upgrade leverage a lucene API version of 3.6.0 as transiently pulled in via jackrabbit-core. Oak on the other hand leverage 4.7.1 (see lucene.version in parent pom).

      While is possible to workaround the javadoc error by something like

      diff --git a/pom.xml b/pom.xml
      index 1b29d27322..6955e8c307 100644
      --- a/pom.xml
      +++ b/pom.xml
      @@ -135,6 +135,13 @@
                   <configuration>
                     <reportOutputDirectory>${basedir}/oak-doc/target/site</reportOutputDirectory>
                     <additionalparam>-notimestamp</additionalparam>
      +              <additionalDependencies>
      +                <additionalDependency>
      +                  <groupId>org.apache.lucene</groupId>
      +                  <artifactId>lucene-core</artifactId>
      +                  <version>3.6.0</version>
      +                </additionalDependency>
      +              </additionalDependencies>
                   </configuration>
                 </plugin>
               </plugins>
      

      adding the right dependency to the oak-upgrade makes it fail to compile hinting to two classes that seem to be gone with the 4.x release of lucene: TermDocs and TermEnum

      diff --git a/oak-upgrade/pom.xml b/oak-upgrade/pom.xml
      index 6907e6e52d..62d818a9df 100644
      --- a/oak-upgrade/pom.xml
      +++ b/oak-upgrade/pom.xml
      @@ -138,6 +138,16 @@
             <groupId>org.apache.tomcat</groupId>
             <artifactId>tomcat-jdbc</artifactId>
           </dependency>
      +    <dependency>
      +      <groupId>org.apache.lucene</groupId>
      +      <artifactId>lucene-core</artifactId>
      +      <version>${lucene.version}</version>
      +    </dependency>
      +    <dependency>
      +      <groupId>org.apache.lucene</groupId>
      +      <artifactId>lucene-analyzers-common</artifactId>
      +      <version>${lucene.version}</version>
      +    </dependency>
       
           <!-- Logging -->
           <dependency>
      
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project oak-upgrade: Compilation failure: Compilation failure: 
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:[139,31] cannot find symbol
      [ERROR]   symbol:   class TermDocs
      [ERROR]   location: package org.apache.lucene.index
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:[140,31] cannot find symbol
      [ERROR]   symbol:   class TermEnum
      [ERROR]   location: package org.apache.lucene.index
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:[1000,13] cannot find symbol
      [ERROR]   symbol:   class TermEnum
      [ERROR]   location: class org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:[1000,36] cannot find symbol
      [ERROR]   symbol:   method terms(org.apache.lucene.index.Term)
      [ERROR]   location: variable reader of type org.apache.lucene.index.IndexReader
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:[1008,21] cannot find symbol
      [ERROR]   symbol:   class TermDocs
      [ERROR]   location: class org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade
      [ERROR] /Users/dgiannel/work/sources/apache/jackrabbit-oak/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java:[1008,43] cannot find symbol
      [ERROR]   symbol:   method termDocs(org.apache.lucene.index.Term)
      [ERROR]   location: variable reader of type org.apache.lucene.index.IndexReader
      

      Attachments

        Issue Links

          Activity

            People

              tomek.rekawek Tomek Rękawek
              edivad Davide Giannella
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: