Created
March 18, 2016 00:23
-
-
Save sh1nj1/32333d1f0a4834281c2c to your computer and use it in GitHub Desktop.
Spark application with SpringBoot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>tv.anypoint</groupId> | |
| <artifactId>spark-spring-boot</artifactId> | |
| <version>0.0.1-SNAPSHOT</version> | |
| <properties> | |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
| <maven.compiler.source>1.8</maven.compiler.source> | |
| <maven.compiler.target>1.8</maven.compiler.target> | |
| <springBootVersion>1.3.3.RELEASE</springBootVersion> | |
| <sparkVersion>1.6.1</sparkVersion> | |
| <hadoopVersion>2.7.1</hadoopVersion> | |
| <scalaVersion>2.11</scalaVersion> | |
| <scalaVersionPatch>8</scalaVersionPatch> | |
| <startClass>com.company.demo.spark.Application</startClass> | |
| </properties> | |
| <build> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>build-helper-maven-plugin</artifactId> | |
| <executions> | |
| <execution> | |
| <id>add-source</id> | |
| <phase>generate-sources</phase> | |
| <goals> | |
| <goal>add-source</goal> | |
| </goals> | |
| <configuration> | |
| <sources> | |
| <source>src/main/scala</source> | |
| </sources> | |
| </configuration> | |
| </execution> | |
| </executions> | |
| </plugin> | |
| <plugin> | |
| <groupId>net.alchim31.maven</groupId> | |
| <artifactId>scala-maven-plugin</artifactId> | |
| <executions> | |
| <execution> | |
| <id>scala-compile-first</id> | |
| <phase>process-sources</phase> | |
| <goals> | |
| <goal>add-source</goal> | |
| <goal>compile</goal> | |
| </goals> | |
| </execution> | |
| <execution> | |
| <id>scala-test-compile</id> | |
| <phase>process-test-sources</phase> | |
| <goals> | |
| <goal>testCompile</goal> | |
| </goals> | |
| </execution> | |
| </executions> | |
| <configuration> | |
| <jvmArgs> | |
| <jvmArg>-Xms64m</jvmArg> | |
| <jvmArg>-Xmx1024m</jvmArg> | |
| </jvmArgs> | |
| </configuration> | |
| </plugin> | |
| <!-- XXX : springboot's executable jar will not work on Spark | |
| <plugin> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-maven-plugin</artifactId> | |
| <version>${springBootVersion}</version> | |
| <executions> | |
| <execution> | |
| <goals> | |
| <goal>repackage</goal> | |
| </goals> | |
| </execution> | |
| </executions> | |
| <configuration> | |
| <excludeGroupIds>org.apache.hadoop,org.apache.spark</excludeGroupIds> | |
| </configuration> | |
| </plugin> | |
| --> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-shade-plugin</artifactId> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-maven-plugin</artifactId> | |
| <version>${springBootVersion}</version> | |
| </dependency> | |
| </dependencies> | |
| <configuration> | |
| <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope> | |
| <createDependencyReducedPom>false</createDependencyReducedPom> | |
| <filters> | |
| <filter> | |
| <artifact>*:*</artifact> | |
| <excludes> | |
| <exclude>META-INF/*.SF</exclude> | |
| <exclude>META-INF/*.DSA</exclude> | |
| <exclude>META-INF/*.RSA</exclude> | |
| </excludes> | |
| </filter> | |
| </filters> | |
| <transformers> | |
| <transformer | |
| implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> | |
| <resource>META-INF/spring.handlers</resource> | |
| </transformer> | |
| <transformer | |
| implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer"> | |
| <resource>META-INF/spring.factories</resource> | |
| </transformer> | |
| <transformer | |
| implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> | |
| <resource>META-INF/spring.schemas</resource> | |
| </transformer> | |
| <transformer | |
| implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> | |
| <transformer | |
| implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | |
| <mainClass>${startClass}</mainClass> | |
| </transformer> | |
| </transformers> | |
| </configuration> | |
| <executions> | |
| <execution> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>shade</goal> | |
| </goals> | |
| </execution> | |
| </executions> | |
| </plugin> | |
| </plugins> | |
| </build> | |
| <dependencies> | |
| <dependency> | |
| <groupId>org.scala-lang</groupId> | |
| <artifactId>scala-library</artifactId> | |
| <version>${scalaVersion}.${scalaVersionPatch}</version> | |
| <scope>provided</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-starter-batch</artifactId> | |
| <version>${springBootVersion}</version> | |
| <scope>compile</scope> | |
| <exclusions> | |
| <exclusion> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-starter-logging</artifactId> | |
| </exclusion> | |
| </exclusions> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.apache.spark</groupId> | |
| <artifactId>spark-core_${scalaVersion}</artifactId> | |
| <version>${sparkVersion}</version> | |
| <scope>provided</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.apache.spark</groupId> | |
| <artifactId>spark-yarn_${scalaVersion}</artifactId> | |
| <version>${sparkVersion}</version> | |
| <scope>provided</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.apache.hadoop</groupId> | |
| <artifactId>hadoop-client</artifactId> | |
| <version>${hadoopVersion}</version> | |
| <scope>provided</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.apache.hadoop</groupId> | |
| <artifactId>hadoop-aws</artifactId> | |
| <version>${hadoopVersion}</version> | |
| <scope>provided</scope> | |
| </dependency> | |
| </dependencies> | |
| <dependencyManagement> | |
| <dependencies> | |
| <!-- Override Spring Data release train provided by Spring Boot --> | |
| <dependency> | |
| <groupId>org.springframework.data</groupId> | |
| <artifactId>spring-data-releasetrain</artifactId> | |
| <version>Fowler-SR2</version> | |
| <scope>import</scope> | |
| <type>pom</type> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-dependencies</artifactId> | |
| <version>${springBootVersion}</version> | |
| <type>pom</type> | |
| <scope>import</scope> | |
| </dependency> | |
| </dependencies> | |
| </dependencyManagement> | |
| </project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does spark core dependency contains spark mllib ?