This is an automated email from the ASF dual-hosted git repository. pradeep pushed a commit to branch RANGER-4076_master in repository https://gitbox.apache.org/repos/asf/ranger.git
commit 818e546488cca215a1410e3c904943a83b01eafa Author: Pradeep AgrawaL <[email protected]> AuthorDate: Sun Dec 21 09:42:18 2025 +0530 RANGER-4706: Enforce Jersey 2 and JUnit 5 via Maven Enforcer and dependency exclusions --- distro/pom.xml | 16 ++++++++++++++++ hdfs-agent/pom.xml | 40 ++++++++++++++++++++++++++++++++++++++++ hive-agent/pom.xml | 5 +++++ plugin-atlas/pom.xml | 18 ++++++++++++++++++ plugin-yarn/pom.xml | 4 ++++ pom.xml | 40 ++++++++++++++++++++++++++++++++++++++++ ranger-atlas-plugin-shim/pom.xml | 9 +++++++++ ranger-hive-plugin-shim/pom.xml | 9 +++++++++ ranger-yarn-plugin-shim/pom.xml | 9 +++++++++ security-admin/pom.xml | 5 +++++ tagsync/pom.xml | 15 +++++++++++++++ 11 files changed, 170 insertions(+) diff --git a/distro/pom.xml b/distro/pom.xml index 709cf9f83..af5cedce5 100644 --- a/distro/pom.xml +++ b/distro/pom.xml @@ -423,6 +423,22 @@ </dependency> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>ban-legacy-dependencies</id> + <phase>none</phase> + <!-- Skip ban-legacy-dependencies check - this module includes tagsync which requires Apache Atlas (uses Jersey 1.x) --> + </execution> + </executions> + </plugin> + </plugins> + </build> + <profiles> <profile> <id>all</id> diff --git a/hdfs-agent/pom.xml b/hdfs-agent/pom.xml index d71295227..c07980c04 100644 --- a/hdfs-agent/pom.xml +++ b/hdfs-agent/pom.xml @@ -56,6 +56,20 @@ <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> <exclusions> + <!-- Exclude pjfanning jersey-json which depends on Jersey 1.x --> + <exclusion> + <groupId>com.github.pjfanning</groupId> + <artifactId>jersey-json</artifactId> + </exclusion> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty-transport-native-epoll</artifactId> @@ -91,6 +105,15 @@ <artifactId>hadoop-hdfs</artifactId> <version>${hadoop.version}</version> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty</artifactId> @@ -129,12 +152,29 @@ <artifactId>ranger-plugins-common</artifactId> <version>${project.version}</version> </dependency> + + <!-- Jersey 1.x for hadoop-minicluster tests (MiniDFSCluster HTTP server needs it) --> + <dependency> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-servlet</artifactId> + <version>1.19.4</version> + <scope>test</scope> + </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-minicluster</artifactId> <version>${hadoop.version}</version> <scope>test</scope> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty</artifactId> diff --git a/hive-agent/pom.xml b/hive-agent/pom.xml index 1bb3273bd..5ae65c006 100644 --- a/hive-agent/pom.xml +++ b/hive-agent/pom.xml @@ -345,6 +345,11 @@ <version>${hadoop.version}</version> <scope>test</scope> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>jersey-guice</artifactId> + </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty</artifactId> diff --git a/plugin-atlas/pom.xml b/plugin-atlas/pom.xml index da0dabdfa..631500c6d 100644 --- a/plugin-atlas/pom.xml +++ b/plugin-atlas/pom.xml @@ -45,6 +45,15 @@ <artifactId>atlas-authorization</artifactId> <version>${atlas.version}</version> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> @@ -56,6 +65,15 @@ <artifactId>atlas-common</artifactId> <version>${atlas.version}</version> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> diff --git a/plugin-yarn/pom.xml b/plugin-yarn/pom.xml index f2fe84112..6eaef53d1 100644 --- a/plugin-yarn/pom.xml +++ b/plugin-yarn/pom.xml @@ -59,6 +59,10 @@ <groupId>com.sun.jersey</groupId> <artifactId>*</artifactId> </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>*</artifactId> diff --git a/pom.xml b/pom.xml index 5dfc31bf8..db9d7f734 100644 --- a/pom.xml +++ b/pom.xml @@ -615,6 +615,46 @@ </rules> </configuration> </execution> + <execution> + <id>ban-legacy-dependencies</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <bannedDependencies> + <excludes> + <!-- Ban JUnit 4 - project has migrated to JUnit 5 --> + <exclude>junit:junit:*:*:compile</exclude> + <exclude>junit:junit:*:*:runtime</exclude> + <exclude>junit:junit:*:*:provided</exclude> + <exclude>junit:junit-dep:*:*:compile</exclude> + <exclude>junit:junit-dep:*:*:runtime</exclude> + <exclude>junit:junit-dep:*:*:provided</exclude> + + <!-- Ban Jersey 1.x - project has migrated to Jersey 2.x (Glassfish) --> + <exclude>com.sun.jersey:*:*:*:compile</exclude> + <exclude>com.sun.jersey:*:*:*:runtime</exclude> + <exclude>com.sun.jersey:*:*:*:provided</exclude> + <exclude>com.sun.jersey.contribs:*:*:*:compile</exclude> + <exclude>com.sun.jersey.contribs:*:*:*:runtime</exclude> + <exclude>com.sun.jersey.contribs:*:*:*:provided</exclude> + </excludes> + <searchTransitive>true</searchTransitive> + <message>❌ Banned dependencies detected! + + This project has migrated to: + - JUnit 5 (org.junit.jupiter:junit-jupiter) - NOT JUnit 4 (junit:junit) + - Jersey 2.x (org.glassfish.jersey.*) - NOT Jersey 1.x (com.sun.jersey:*) + + Test-scoped dependencies are allowed for compatibility with test infrastructure. + + Please update your dependencies accordingly.</message> + </bannedDependencies> + </rules> + <fail>true</fail> + </configuration> + </execution> </executions> </plugin> <plugin> diff --git a/ranger-atlas-plugin-shim/pom.xml b/ranger-atlas-plugin-shim/pom.xml index 2f2c7d86f..19a45687c 100644 --- a/ranger-atlas-plugin-shim/pom.xml +++ b/ranger-atlas-plugin-shim/pom.xml @@ -40,6 +40,15 @@ <artifactId>atlas-authorization</artifactId> <version>${atlas.version}</version> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> diff --git a/ranger-hive-plugin-shim/pom.xml b/ranger-hive-plugin-shim/pom.xml index c452b30e0..e94d160e2 100644 --- a/ranger-hive-plugin-shim/pom.xml +++ b/ranger-hive-plugin-shim/pom.xml @@ -36,6 +36,15 @@ <artifactId>hive-exec</artifactId> <version>${hive.version}</version> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty</artifactId> diff --git a/ranger-yarn-plugin-shim/pom.xml b/ranger-yarn-plugin-shim/pom.xml index 929f04721..1327f1a6d 100644 --- a/ranger-yarn-plugin-shim/pom.xml +++ b/ranger-yarn-plugin-shim/pom.xml @@ -36,6 +36,15 @@ <artifactId>hadoop-yarn-common</artifactId> <version>${hadoop.version}</version> <exclusions> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey</groupId> + <artifactId>*</artifactId> + </exclusion> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>*</artifactId> + </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>*</artifactId> diff --git a/security-admin/pom.xml b/security-admin/pom.xml index e86ce30b7..95eafbdbf 100644 --- a/security-admin/pom.xml +++ b/security-admin/pom.xml @@ -374,6 +374,11 @@ <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> </exclusion> + <!-- Exclude Jersey 1.x - project uses Jersey 2.x --> + <exclusion> + <groupId>com.sun.jersey.contribs</groupId> + <artifactId>jersey-guice</artifactId> + </exclusion> <exclusion> <groupId>io.netty</groupId> <artifactId>netty</artifactId> diff --git a/tagsync/pom.xml b/tagsync/pom.xml index 8f9d3803b..3e4af5ffb 100644 --- a/tagsync/pom.xml +++ b/tagsync/pom.xml @@ -513,4 +513,19 @@ <scope>test</scope> </dependency> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>ban-legacy-dependencies</id> + <phase>none</phase> + <!-- Skip ban-legacy-dependencies check - this module requires Apache Atlas which uses Jersey 1.x --> + </execution> + </executions> + </plugin> + </plugins> + </build> </project>
