Using shaded lucene dependency for jcr oak

This commit is contained in:
Martin Stockhammer 2020-06-28 00:12:36 +02:00
parent ec0ecb744b
commit 5a35e01601
7 changed files with 260 additions and 79 deletions

View File

@ -324,12 +324,12 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>${htmlUnitVersion}</version>
<version>${html.unit.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>${htmlUnitVersion}</version>
<version>${html.unit.version}</version>
<scope>test</scope>
</dependency>

View File

@ -336,7 +336,7 @@
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>${htmlUnitVersion}</version>
<version>${html.unit.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>

View File

@ -57,6 +57,13 @@
<groupId>org.apache.archiva.maven</groupId>
<artifactId>archiva-maven-metadata</artifactId>
</dependency>
<!-- This is a oak-lucene package with shaded lucene dependencies -->
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>oak-jcr-lucene</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
@ -77,21 +84,6 @@
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-segment-tar</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-lucene</artifactId>
<version>${jcr-oak.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-misc</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-facet</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-api</artifactId>
@ -130,52 +122,6 @@
<artifactId>javax.annotation-api</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-misc</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-facet</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-codecs</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-sandbox</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-memory</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>

View File

@ -0,0 +1 @@
dependency-reduced-pom.xml

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>plugins</artifactId>
<groupId>org.apache.archiva</groupId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>oak-jcr-lucene</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-lucene</artifactId>
<version>${jcr-oak.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-memory</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-sandbox</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-suggest</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-core-spi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-store-spi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-query-spi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-store-document</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-search</artifactId>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes>
<exclude>dependency-reduced-pom.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- download source code in Eclipse, best practice -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<!-- Set a compiler level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<!-- Maven Shade Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<!-- Run shade goal on package phase -->
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/NOTICE.TXT</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>LICENSE.TXT</exclude>
</excludes>
</filter>
</filters>
<artifactSet>
<excludes>
<exclude>org.apache.jackrabbit:jackrabbit-data</exclude>
<exclude>org.apache.jackrabbit:jackrabbit-jcr-commons</exclude>
<exclude>org.apache.jackrabbit:oak-api</exclude>
<exclude>org.apache.jackrabbit:oak-blob</exclude>
<exclude>org.apache.jackrabbit:oak-blob-plugins</exclude>
<exclude>org.apache.jackrabbit:oak-commons</exclude>
<exclude>org.apache.jackrabbit:oak-core</exclude>
<exclude>org.apache.jackrabbit:oak-core-spi</exclude>
<exclude>org.apache.jackrabbit:oak-jackrabbit-api</exclude>
<exclude>org.apache.jackrabbit:oak-query-spi</exclude>
<exclude>org.apache.jackrabbit:oak-search</exclude>
<exclude>org.apache.jackrabbit:oak-security-spi</exclude>
<exclude>org.apache.jackrabbit:oak-store-document</exclude>
<exclude>org.apache.jackrabbit:oak-store-spi</exclude>
<exclude>org.apache.tika:tika-core</exclude>
<exclude>org.osgi:org.osgi.annotation</exclude>
<exclude>org.osgi:org.osgi.service.component.annotations</exclude>
<exclude>org.osgi:org.osgi.service.metatype.annotations</exclude>
<exclude>org.slf4j:jcl-over-slf4j</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>commons-codec:commons-codec</exclude>
<exclude>commons-io:commons-io</exclude>
<exclude>com.google.guava:guava</exclude>
<exclude>javax.jcr:jcr</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.apache.lucene</pattern>
<shadedPattern>shaded_oak.org.apache.lucene</shadedPattern>
</relocation>
<relocation>
<pattern>org.tartarus.snowball</pattern>
<shadedPattern>shaded_oak.org.tartarus.snowball</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -41,6 +41,7 @@
<module>generic-metadata-support</module>
<module>metadata-store-jcr</module>
<module>metadata-store-cassandra</module>
<module>oak-jcr-lucene</module>
</modules>
</project>

47
pom.xml
View File

@ -72,7 +72,7 @@
<!-- JCR modules -->
<javax.jcr.version>2.0</javax.jcr.version>
<jcr-oak.version>1.14.0</jcr-oak.version>
<jcr-oak.version>1.22.3</jcr-oak.version>
<!-- Jackrabbit classes are still used for webdav -->
<jackrabbit.version>2.15.4</jackrabbit.version>
<metrics-core.version>3.1.0</metrics-core.version>
@ -85,6 +85,19 @@
<modelmapper.version>2.3.5</modelmapper.version>
<sisu-inject-plexus.version>0.3.3</sisu-inject-plexus.version>
<plexus-utils.version>3.1.0</plexus-utils.version>
<html.unit.version>2.27</html.unit.version>
<springockito.version>1.0.9</springockito.version>
<mockito.version>1.9.5</mockito.version>
<easymock.version>4.1</easymock.version>
<jacoco.plugin.version>0.7.9</jacoco.plugin.version>
<joda.time.version>1.5.2</joda.time.version>
<!-- restore when we will be able to use a derby in memory database -->
<redbackTestJdbcUrl>jdbc:derby:memory:users-test;create=true</redbackTestJdbcUrl>
<redbackTestJdbcDriver>org.apache.derby.jdbc.EmbeddedDriver</redbackTestJdbcDriver>
@ -93,25 +106,11 @@
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
<sisu-inject-plexus.version>0.3.3</sisu-inject-plexus.version>
<plexus-digest.version>1.1</plexus-digest.version>
<plexus-expression-evaluator.version>2.1</plexus-expression-evaluator.version>
<plexus-utils.version>3.1.0</plexus-utils.version>
<plexus-slf4j-version>1.1</plexus-slf4j-version>
<htmlUnitVersion>2.27</htmlUnitVersion>
<release.preparationGoals>clean install</release.preparationGoals>
<springockito.version>1.0.9</springockito.version>
<mockito.version>1.9.5</mockito.version>
<easymock.version>4.1</easymock.version>
<openjpa.Log>DefaultLevel=INFO,Runtime=ERROR,Tool=ERROR,SQL=ERROR,Schema=ERROR,MetaData=ERROR</openjpa.Log>
<jacocoproperty/>
<jacoco.plugin.version>0.7.9</jacoco.plugin.version>
<joda.time.version>1.5.2</joda.time.version>
</properties>
@ -518,6 +517,7 @@
<version>${jcr-oak.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-lucene</artifactId>
@ -545,6 +545,23 @@
<version>${jackrabbit.version}</version>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>oak-jcr-lucene</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-store-document</artifactId>
<version>${jcr-oak.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-search</artifactId>
<version>${jcr-oak.version}</version>
</dependency>
<!-- Maven dependencies -->