Skip to content

Commit ba75ecf

Browse files
committed
Only apply -XDignore.symbol.file flag in unsafe project.
1 parent 7403345 commit ba75ecf

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,6 @@
11621162
<javacArg>${java.version}</javacArg>
11631163
<javacArg>-target</javacArg>
11641164
<javacArg>${java.version}</javacArg>
1165-
<!-- This option is needed to suppress warnings from sun.misc.Unsafe usage -->
1166-
<javacArg>-XDignore.symbol.file</javacArg>
11671165
</javacArgs>
11681166
<!-- The following plugin is required to use quasiquotes in Scala 2.10 and is used
11691167
by Spark SQL for code generation. -->
@@ -1186,10 +1184,6 @@
11861184
<encoding>UTF-8</encoding>
11871185
<maxmem>1024m</maxmem>
11881186
<fork>true</fork>
1189-
<compilerArgs>
1190-
<!-- This option is needed to suppress warnings from sun.misc.Unsafe usage -->
1191-
<arg>-XDignore.symbol.file</arg>
1192-
</compilerArgs>
11931187
</configuration>
11941188
</plugin>
11951189
<!-- Surefire runs all Java tests -->

project/SparkBuild.scala

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ object SparkBuild extends PomBuild {
140140
javacOptions in (Compile, doc) ++= {
141141
val Array(major, minor, _) = System.getProperty("java.version").split("\\.", 3)
142142
if (major.toInt >= 1 && minor.toInt >= 8) Seq("-Xdoclint:all", "-Xdoclint:-missing") else Seq.empty
143-
},
144-
// This option is needed to suppress warnings from sun.misc.Unsafe usage
145-
javacOptions in Compile += "-XDignore.symbol.file"
143+
}
146144
)
147145

148146
def enable(settings: Seq[Setting[_]])(projectRef: ProjectRef) = {
@@ -165,6 +163,9 @@ object SparkBuild extends PomBuild {
165163
x => enable(MimaBuild.mimaSettings(sparkHome, x))(x)
166164
}
167165

166+
/* Unsafe settings */
167+
enable(Unsafe.settings)(unsafe)
168+
168169
/* Enable Assembly for all assembly projects */
169170
assemblyProjects.foreach(enable(Assembly.settings))
170171

@@ -218,6 +219,13 @@ object SparkBuild extends PomBuild {
218219

219220
}
220221

222+
object Unsafe {
223+
lazy val settings = Seq(
224+
// This option is needed to suppress warnings from sun.misc.Unsafe usage
225+
javacOptions in Compile += "-XDignore.symbol.file"
226+
)
227+
}
228+
221229
object Flume {
222230
lazy val settings = sbtavro.SbtAvro.avroSettings
223231
}

unsafe/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,29 @@
6565
<build>
6666
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
6767
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
68+
<pluginManagement>
69+
<plugins>
70+
<plugin>
71+
<groupId>net.alchim31.maven</groupId>
72+
<artifactId>scala-maven-plugin</artifactId>
73+
<configuration>
74+
<javacArgs>
75+
<!-- This option is needed to suppress warnings from sun.misc.Unsafe usage -->
76+
<javacArg>-XDignore.symbol.file</javacArg>
77+
</javacArgs>
78+
</configuration>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-compiler-plugin</artifactId>
83+
<configuration>
84+
<compilerArgs>
85+
<!-- This option is needed to suppress warnings from sun.misc.Unsafe usage -->
86+
<arg>-XDignore.symbol.file</arg>
87+
</compilerArgs>
88+
</configuration>
89+
</plugin>
90+
</plugins>
91+
</pluginManagement>
6892
</build>
6993
</project>

0 commit comments

Comments
 (0)