Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions distro/src/main/assembly/plugin-elasticsearch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
<includes>
<include>commons-collections:commons-collections</include>
<include>commons-lang:commons-lang</include>
<include>org.slf4j:slf4j-api</include>
<include>org.slf4j:slf4j-log4j12</include>
<include>org.apache.logging.log4j:log4j-api:${slf4j2.version}</include>
<include>org.apache.logging.log4j:log4j-core:${slf4j2.version}</include>
<include>org.apache.logging.log4j:log4j-1.2-api:${slf4j2.version}</include>
<include>org.apache.logging.log4j:log4j-slf4j-impl:${slf4j2.version}</include>
</includes>
</binaries>
</moduleSet>
Expand Down Expand Up @@ -121,7 +123,10 @@
<include>commons-lang:commons-lang:jar:${commons.lang.version}</include>
<include>commons-logging:commons-logging:jar:${commons.logging.version}</include>
<include>com.google.guava:guava:jar:${google.guava.version}</include>
<include>org.slf4j:slf4j-api:jar:${slf4j-api.version}</include>
<include>org.apache.logging.log4j:log4j-api:${slf4j2.version}</include>
<include>org.apache.logging.log4j:log4j-core:${slf4j2.version}</include>
<include>org.apache.logging.log4j:log4j-1.2-api:${slf4j2.version}</include>
<include>org.apache.logging.log4j:log4j-slf4j-impl:${slf4j2.version}</include>
<include>org.apache.hadoop:hadoop-common:jar:${hadoop.version}</include>
<include>org.apache.hadoop:hadoop-auth:jar:${hadoop.version}</include>
<include>org.apache.ranger:ranger-plugins-cred</include>
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
<security-agent-install-dir>hadoop-security/plugins</security-agent-install-dir>
<servlet.api.version>2.5</servlet.api.version>
<slf4j-api.version>1.7.30</slf4j-api.version>
<slf4j2.version>2.17.2</slf4j2.version>
<solr.version>7.7.1</solr.version>
<spring-ldap-core.version>2.3.3.RELEASE</spring-ldap-core.version>
<springframework.security.version>5.5.0</springframework.security.version>
Expand Down Expand Up @@ -224,7 +225,7 @@
<lucene.version>8.4.0</lucene.version>
<hppc.version>0.8.0</hppc.version>
<joda.time.version>2.10.6</joda.time.version>
<log4j.core.version>2.13.3</log4j.core.version>
<log4j.core.version>2.17.2</log4j.core.version>
</properties>
<profiles>
<profile>
Expand Down
23 changes: 18 additions & 5 deletions ranger-elasticsearch-plugin-shim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,25 @@
<artifactId>commons-lang</artifactId>
<version>${commons.lang.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-api.version}</version>
<scope>runtime</scope>
<groupId>org.apache.logging.log4j</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ranger-elasticsearch-plugin-shim.jar shouldn't require log4j implementation libraries; Sources in this library only refer to org.slf4j.Logger and org.slf4j.LoggerFactory; so depdency on slf4j-api should be the enough. The implementation libraries, log4j for Elasticsearch, should be picked up at runtime from Elasticsearch classpath. It shouldn't be necessary to package them with Ranger plugin.

Also, looking at the stack trace in RANGER-3696, it seems Elastisearch already has class isolation in place for plugins (so that libraries used in the plugin are not visible to Elasticsearch). If this is true, then I suggest getting rid of ranger-elasticsearch-plugin-shim library altogether.

<artifactId>log4j-api</artifactId>
<version>${slf4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${slf4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>${slf4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${slf4j2.version}</version>
</dependency>
</dependencies>
</project>