Skip to content

Commit

Permalink
CDAP-9473 use api-spark-base as source
Browse files Browse the repository at this point in the history
The spark and spark2 api modules will use the api-spark-base
module as source code in the dist profile, to ensure that the
base classes get compiled using the correct version of scala.

Also added a cdap-dev maven profile that adds cdap-api-spark-base
as a dependency of the api modules. This profile is purely
for use in IDEs, so that they don't get confused by two modules
using the same files as source.

CDAP-9473 skip deploy plugin for cdap-api-spark-base
  • Loading branch information
albertshau committed May 1, 2017
1 parent 0e9f821 commit 45d3fae
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 15 deletions.
8 changes: 8 additions & 0 deletions cdap-api-spark-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright © 2017 Cask Data, Inc.
*
* Licensed 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.
*/

/**
* Interfaces for Spark interactions.
*/
package co.cask.cdap.api.spark;



41 changes: 35 additions & 6 deletions cdap-api-spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@
</parent>

<artifactId>cdap-api-spark</artifactId>
<name>CDAP Spark API</name>
<name>CDAP Spark API Scala 2.10</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>co.cask.cdap</groupId>
<artifactId>cdap-api-spark-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>co.cask.cdap</groupId>
<artifactId>cdap-api</artifactId>
Expand Down Expand Up @@ -186,7 +181,41 @@
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<!-- copy the source from cdap-api-spark-base in order to compile everything as scala 2.11 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.parent.basedir}/cdap-api-spark-base/src/main</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>cdap-dev</id>
<dependencies>
<!-- here for IDEs, so that cdap-api-spark-base is recognized as a source for both cdap-api-spark modules -->
<dependency>
<groupId>co.cask.cdap</groupId>
<artifactId>cdap-api-spark-base</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
43 changes: 36 additions & 7 deletions cdap-api-spark2/pom.xml → cdap-api-spark2_2.11/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@
<version>4.2.0-SNAPSHOT</version>
</parent>

<artifactId>cdap-api-spark2</artifactId>
<name>CDAP Spark API</name>
<artifactId>cdap-api-spark2_2.11</artifactId>
<name>CDAP Spark2 API Scala 2.11</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>co.cask.cdap</groupId>
<artifactId>cdap-api-spark-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>co.cask.cdap</groupId>
<artifactId>cdap-api</artifactId>
Expand Down Expand Up @@ -186,7 +181,41 @@
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<!-- copy the source from cdap-api-spark-base in order to compile everything as scala 2.11 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.parent.basedir}/cdap-api-spark-base/src/main</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>cdap-dev</id>
<dependencies>
<!-- here for IDEs, so that cdap-api-spark-base is recognized as a source for both cdap-api-spark modules -->
<dependency>
<groupId>co.cask.cdap</groupId>
<artifactId>cdap-api-spark-base</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
2 changes: 1 addition & 1 deletion cdap-spark-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeArtifactIds>cdap-api-spark,cdap-api-spark-base</includeArtifactIds>
<includeArtifactIds>cdap-api-spark</includeArtifactIds>
<prependGroupId>true</prependGroupId>
<silent>true</silent>
<includeScope>runtime</includeScope>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2582,7 +2582,7 @@
<module>cdap-spi</module>
<module>cdap-api</module>
<module>cdap-api-spark</module>
<module>cdap-api-spark2</module>
<module>cdap-api-spark2_2.11</module>
<module>cdap-api-spark-base</module>
<module>cdap-formats</module>
<module>cdap-hbase-compat-base</module>
Expand Down

0 comments on commit 45d3fae

Please sign in to comment.