IntelliJ IDEA spark maven

0. 新建maven项目

 

1. 主要就是porm.xml 里添加依赖



    4.0.0

    test
    WordCount
    1.0-SNAPSHOT

    
        2.3.0
        2.11
    

    
        
            org.apache.spark
            spark-core_${scala.version}
            ${spark.version}
        

        
            org.apache.spark
            spark-streaming_${scala.version}
            ${spark.version}
        
        
            org.apache.spark
            spark-sql_${scala.version}
            ${spark.version}
        
        
            org.apache.spark
            spark-hive_${scala.version}
            ${spark.version}
        
        
            org.apache.spark
            spark-mllib_${scala.version}
            ${spark.version}
        
    

    
        
            
                org.scala-tools
                maven-scala-plugin
                2.15.2
                
                    
                        
                            compile
                            testCompile
                        
                    
                
            

            
                maven-compiler-plugin
                3.6.0
                
                    1.8
                    1.8
                
            

            
                org.apache.maven.plugins
                maven-surefire-plugin
                2.19
                
                    true
                
            
        
    

2. 编译命令

mvn clean package

参考文章

http://www.codeblogbt.com/archives/151106

 

你可能感兴趣的:(spark)