Repository: spark
Updated Branches:
  refs/heads/master 9293734d3 -> b678e465a


[SPARK-17346][SQL][TEST-MAVEN] Generate the sql test jar to fix the maven build

## What changes were proposed in this pull request?

Generate the sql test jar to fix the maven build

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <shixi...@databricks.com>

Closes #15368 from zsxwing/sql-test-jar.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b678e465
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b678e465
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b678e465

Branch: refs/heads/master
Commit: b678e465afa417780b54db0fbbaa311621311f15
Parents: 9293734
Author: Shixiong Zhu <shixi...@databricks.com>
Authored: Wed Oct 5 18:11:31 2016 -0700
Committer: Tathagata Das <tathagata.das1...@gmail.com>
Committed: Wed Oct 5 18:11:31 2016 -0700

----------------------------------------------------------------------
 external/kafka-0-10-sql/pom.xml                 | 14 ++++++++++
 .../spark/sql/kafka010/KafkaSourceSuite.scala   |  1 +
 sql/core/pom.xml                                | 27 ++++++++++++++++++++
 3 files changed, 42 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/b678e465/external/kafka-0-10-sql/pom.xml
----------------------------------------------------------------------
diff --git a/external/kafka-0-10-sql/pom.xml b/external/kafka-0-10-sql/pom.xml
index b96445a..ebff5fd 100644
--- a/external/kafka-0-10-sql/pom.xml
+++ b/external/kafka-0-10-sql/pom.xml
@@ -43,6 +43,20 @@
     </dependency>
     <dependency>
       <groupId>org.apache.spark</groupId>
+      <artifactId>spark-core_${scala.binary.version}</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.spark</groupId>
+      <artifactId>spark-catalyst_${scala.binary.version}</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.spark</groupId>
       <artifactId>spark-sql_${scala.binary.version}</artifactId>
       <version>${project.version}</version>
       <type>test-jar</type>

http://git-wip-us.apache.org/repos/asf/spark/blob/b678e465/external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSourceSuite.scala
----------------------------------------------------------------------
diff --git 
a/external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSourceSuite.scala
 
b/external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSourceSuite.scala
index 64bf503..6c03070 100644
--- 
a/external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSourceSuite.scala
+++ 
b/external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaSourceSuite.scala
@@ -151,6 +151,7 @@ class KafkaSourceSuite extends KafkaSourceTest {
     val mapped = kafka.map(kv => kv._2.toInt + 1)
 
     testStream(mapped)(
+      makeSureGetOffsetCalled,
       StopStream
     )
   }

http://git-wip-us.apache.org/repos/asf/spark/blob/b678e465/sql/core/pom.xml
----------------------------------------------------------------------
diff --git a/sql/core/pom.xml b/sql/core/pom.xml
index 84de1d4..7da7715 100644
--- a/sql/core/pom.xml
+++ b/sql/core/pom.xml
@@ -132,6 +132,33 @@
     
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
     
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
     <plugins>
+       <!--
+            This plugin forces the generation of jar containing sql test 
classes,
+            so that the tests classes of external modules can use them. The 
two execution profiles
+            are necessary - first one for 'mvn package', second one for 'mvn 
test-compile'. Ideally,
+            'mvn compile' should not compile test classes and therefore should 
not need this.
+            However, an open Maven bug 
(http://jira.codehaus.org/browse/MNG-3559)
+            causes the compilation to fail if catalyst test-jar is not 
generated. Hence, the
+            second execution profile for 'mvn test-compile'.
+      -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>test-jar-on-test-compile</id>
+            <phase>test-compile</phase>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to