Skip to content

Commit daee555

Browse files
committed
Change yetus dependency to compile in spark modules
Due to Spark’s usage of reflection the Yetus annotation is required at runtime. Because it is getting in the way of other development and Yetus is a small dependency, I changed the scope to compile in the Spark modules to ensure the class is available. See KUDU-2500 for details and to track the final solution. Change-Id: I16867a75b7f29f57c557449f94e52439cb9642c9 Reviewed-on: http://gerrit.cloudera.org:8080/10927 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <mpercy@apache.org> Reviewed-by: Tony Foerster <anthonymfoerster@gmail.com>
1 parent d074de8 commit daee555

File tree

6 files changed

+24
-27
lines changed

6 files changed

+24
-27
lines changed

java/kudu-backup/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ dependencies {
3131
// Make sure wrong Scala version is not pulled in.
3232
exclude group: "org.scala-lang", module: "scala-library"
3333
}
34+
// TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime.
35+
compile libs.yetusAnnotations
3436

3537
provided libs.scalaLibrary
3638
provided libs.sparkAvro
3739
provided libs.sparkCore
3840
provided libs.sparkSql
3941
provided libs.slf4jApi
4042

41-
optional libs.yetusAnnotations
42-
4343
testCompile project(path: ":kudu-client", configuration: "shadowTest")
4444
testCompile project(path: ":kudu-spark", configuration: "test")
4545
testCompile libs.junit

java/kudu-backup/pom.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
</exclusion>
7171
</exclusions>
7272
</dependency>
73+
<!-- TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime. -->
74+
<dependency>
75+
<groupId>org.apache.yetus</groupId>
76+
<artifactId>audience-annotations</artifactId>
77+
<version>${yetus.version}</version>
78+
</dependency>
7379

7480
<dependency>
7581
<groupId>com.databricks</groupId>
@@ -102,14 +108,6 @@
102108
<scope>provided</scope>
103109
</dependency>
104110

105-
<dependency>
106-
<groupId>org.apache.yetus</groupId>
107-
<artifactId>audience-annotations</artifactId>
108-
<version>${yetus.version}</version>
109-
<optional>true</optional>
110-
</dependency>
111-
112-
113111
<dependency>
114112
<groupId>org.apache.kudu</groupId>
115113
<artifactId>kudu-${spark.version.label}_${scala.binary.version}</artifactId>

java/kudu-spark-tools/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ dependencies {
2222
compile project(path: ":kudu-client", configuration: "shadow")
2323
compile project(path: ":kudu-client-tools", configuration: "shadow")
2424
compile project(path: ":kudu-spark", configuration: "shadow")
25+
// TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime.
26+
compile libs.yetusAnnotations
2527

2628
provided libs.scalaLibrary
2729
provided libs.sparkAvro
2830
provided libs.sparkCore
2931
provided libs.sparkSql
3032
provided libs.slf4jApi
3133

32-
optional libs.yetusAnnotations
33-
3434
testCompile project(path: ":kudu-client", configuration: "shadowTest")
3535
testCompile project(path: ":kudu-spark", configuration: "test")
3636
testCompile libs.junit

java/kudu-spark-tools/pom.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
<artifactId>kudu-${spark.version.label}_${scala.binary.version}</artifactId>
4848
<version>${project.version}</version>
4949
</dependency>
50+
<!-- TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime. -->
51+
<dependency>
52+
<groupId>org.apache.yetus</groupId>
53+
<artifactId>audience-annotations</artifactId>
54+
<version>${yetus.version}</version>
55+
</dependency>
5056

5157
<dependency>
5258
<groupId>com.databricks</groupId>
@@ -91,13 +97,6 @@
9197
<scope>provided</scope>
9298
</dependency>
9399

94-
<dependency>
95-
<groupId>org.apache.yetus</groupId>
96-
<artifactId>audience-annotations</artifactId>
97-
<version>${yetus.version}</version>
98-
<optional>true</optional>
99-
</dependency>
100-
101100
<dependency>
102101
<groupId>org.apache.kudu</groupId>
103102
<artifactId>kudu-client</artifactId>

java/kudu-spark/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ apply from: "$rootDir/gradle/shadow.gradle"
2020

2121
dependencies {
2222
compile project(path: ":kudu-client", configuration: "shadow")
23+
// TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime.
24+
compile libs.yetusAnnotations
2325

2426
provided libs.scalaLibrary
2527
provided libs.sparkCore
2628
provided libs.sparkSql
2729
provided libs.slf4jApi
2830

29-
optional libs.yetusAnnotations
3031

3132
testCompile project(path: ":kudu-client", configuration: "shadowTest")
3233
testCompile libs.junit

java/kudu-spark/pom.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
<artifactId>kudu-client</artifactId>
3030
<version>${project.version}</version>
3131
</dependency>
32+
<!-- TODO(KUDU-2500): Spark uses reflection which requires the annotations at runtime. -->
33+
<dependency>
34+
<groupId>org.apache.yetus</groupId>
35+
<artifactId>audience-annotations</artifactId>
36+
<version>${yetus.version}</version>
37+
</dependency>
3238

3339
<dependency>
3440
<groupId>org.apache.spark</groupId>
@@ -67,13 +73,6 @@
6773
<scope>provided</scope>
6874
</dependency>
6975

70-
<dependency>
71-
<groupId>org.apache.yetus</groupId>
72-
<artifactId>audience-annotations</artifactId>
73-
<version>${yetus.version}</version>
74-
<optional>true</optional>
75-
</dependency>
76-
7776
<dependency>
7877
<groupId>org.apache.kudu</groupId>
7978
<artifactId>kudu-client</artifactId>

0 commit comments

Comments
 (0)