Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-2261 Isolate Curator Dependencies #1515

45 changes: 33 additions & 12 deletions metron-analytics/metron-maas-common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?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.
<!--
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"
Expand Down Expand Up @@ -54,11 +54,25 @@
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${global_curator_version}</version>
<exclusions>
<exclusion>
<!-- need to exclude zookeeper 3.5.x http://curator.apache.org/zk-compatibility.html -->
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-x-discovery</artifactId>
<version>${global_curator_version}</version>
<exclusions>
<exclusion>
<!-- need to exclude zookeeper 3.5.x http://curator.apache.org/zk-compatibility.html -->
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -83,8 +97,15 @@
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<version>${curator.version}</version>
<version>${global_curator_test_version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<!-- need to exclude zookeeper 3.5.x http://curator.apache.org/zk-compatibility.html -->
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>
Expand Down
76 changes: 59 additions & 17 deletions metron-analytics/metron-maas-service/pom.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?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.
<!--
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"
Expand Down Expand Up @@ -59,6 +59,23 @@
<artifactId>hadoop-yarn-server-common</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
<exclusions>
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing we might consider with these bigger dep exclusions (and this is just an idea, entirely up to you) is using wildcards.

        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>2.7.1</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.curator</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
        </dependency>

I found this results in all curator deps from hadoop-common being excluded whereas previously I had the following:

grep curator /tmp/deptree.txt
[INFO]    |  \- org.apache.curator:curator-framework:jar:2.7.1:compile
[INFO]    +- org.apache.curator:curator-client:jar:2.7.1:compile
[INFO]    +- org.apache.curator:curator-recipes:jar:2.7.1:compile

I'm not sure if this is too big a net to cast or not. The dependency plugin doesn't appear to do globs, only full wildcard matching at the artifactId or groupId level. e.g. "curator*" will not work in the artifactId, unfortunately. Just an idea.

This is the Maven feature - https://issues.apache.org/jira/browse/MNG-2315

Copy link
Contributor Author

@nickwallen nickwallen Sep 19, 2019

Choose a reason for hiding this comment

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

That's a nice feature. I'd prefer to use it.

Unfortunately, I tried it like your example and I don't seem to work as I'd expect. When I use a wildcard, I still get old 2.12.0 dependencies showing up.

<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
Expand Down Expand Up @@ -94,6 +111,13 @@
<artifactId>hadoop-yarn-common</artifactId>
<version>${hadoop.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
Expand All @@ -119,16 +143,19 @@
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x-->
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -211,6 +238,21 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
7 changes: 7 additions & 0 deletions metron-analytics/metron-profiler-spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>${global_spark_version}</version>
<exclusions>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with spark 2.3.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
Expand Down
35 changes: 35 additions & 0 deletions metron-analytics/metron-profiler-storm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
<exclusion>
<!-- need to exclude zookeeper 3.4.9 with hadoop 3.1.x -->
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -94,6 +114,21 @@
<artifactId>commons-lang</artifactId>
<groupId>commons-lang</groupId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
23 changes: 21 additions & 2 deletions metron-interface/metron-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<antlr.version>4.5</antlr.version>
<curator.version>2.7.1</curator.version>
<powermock.version>1.6.4</powermock.version>
<spring.boot.version>2.0.1.RELEASE</spring.boot.version>
<spring.kerberos.version>1.0.1.RELEASE</spring.kerberos.version>
Expand Down Expand Up @@ -127,7 +126,7 @@
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
<version>${global_curator_version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
Expand All @@ -137,6 +136,11 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<!-- need to exclude zookeeper 3.5.x http://curator.apache.org/zk-compatibility.html -->
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -246,6 +250,21 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<!-- to avoid pulling in curator 2.12.0 with hadoop 3.1.x -->
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,34 @@
<artifactId>flux-core</artifactId>
<version>${global_flux_version}</version>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${global_zookeeper_version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>${global_curator_version}</version>
<exclusions>
<exclusion>
<!-- need to exclude zookeeper 3.5.x http://curator.apache.org/zk-compatibility.html -->
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
<version>${global_curator_version}</version>
<version>${global_curator_test_version}</version>
<exclusions>
<exclusion>
<!-- need to exclude zookeeper 3.5.x http://curator.apache.org/zk-compatibility.html -->
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading