大数据项目之电商框架搭建项目父工程

发布时间:2021年11月25日作者:atguigu浏览次数:104

1、项目父工程

sparkmall

添加pom文件

<properties>

        <spark.version>2.1.1</spark.version>

        <scala.version>2.11.8</scala.version>

        <log4j.version>1.2.17</log4j.version>

        <slf4j.version>1.7.22</slf4j.version>

    </properties>

    <dependencies>

        <!–此处放日志包,所有项目都要引用–>

        <!– 所有子项目的日志框架 –>

        <dependency>

            <groupId>org.slf4j</groupId>

            <artifactId>jcl-over-slf4j</artifactId>

            <version>${slf4j.version}</version>

        </dependency>

        <dependency>

            <groupId>org.slf4j</groupId>

            <artifactId>slf4j-api</artifactId>

            <version>${slf4j.version}</version>

        </dependency>

        <dependency>

            <groupId>org.slf4j</groupId>

            <artifactId>slf4j-log4j12</artifactId>

            <version>${slf4j.version}</version>

        </dependency>

        <!– 具体的日志实现 –>

        <dependency>

            <groupId>log4j</groupId>

            <artifactId>log4j</artifactId>

            <version>${log4j.version}</version>

        </dependency>

    </dependencies>

    <dependencyManagement>

        <!–此处声明工具依赖,各个模块,选择使用–>

        <dependencies>

            <dependency>

                <groupId>org.apache.spark</groupId>

                <artifactId>spark-core_2.11</artifactId>

                <version>${spark.version}</version>

                <!– provider如果存在,那么运行时该Jar包不存在,也不会打包到最终的发布版本中,只是编译器有效 –>

                <!–<scope>provided</scope>–>

            </dependency>

            <dependency>

                <groupId>org.apache.spark</groupId>

                <artifactId>spark-sql_2.11</artifactId>

                <version>${spark.version}</version>

                <!–<scope>provided</scope>–>

            </dependency>

            <dependency>

                <groupId>org.apache.spark</groupId>

                <artifactId>spark-streaming_2.11</artifactId>

                <version>${spark.version}</version>

                <!–<scope>provided</scope>–>

            </dependency>

            <dependency>

                <groupId>org.apache.spark</groupId>

                <artifactId>spark-mllib_2.11</artifactId>

                <version>${spark.version}</version>

                <!–<scope>provided</scope>–>

            </dependency>

            <dependency>

                <groupId>org.apache.spark</groupId>

                <artifactId>spark-graphx_2.11</artifactId>

                <version>${spark.version}</version>

                <!–<scope>provided</scope>–>

            </dependency>

            <dependency>

                <groupId>org.scala-lang</groupId>

                <artifactId>scala-library</artifactId>

                <version>${scala.version}</version>

                <!–<scope>provided</scope>–>

            </dependency>

            <dependency>

                <groupId>org.apache.spark</groupId>

                <artifactId>spark-hive_2.11</artifactId>

                <version>${spark.version}</version>

                <!–<scope>provided</scope>–>

            </dependency>

            <dependency>

                <groupId>org.apache.spark</groupId>

                <artifactId>spark-streaming-kafka-0-10_2.11</artifactId>

                <version>${spark.version}</version>

            </dependency>

 

        </dependencies>

 

 

    </dependencyManagement>

 

    <build>

        <!– 声明并引入子项目共有的插件【插件就是附着到Maven各个声明周期的具体实现】 –>

        <plugins>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-compiler-plugin</artifactId>

                <version>3.6.1</version>

                <!– 所有的编译都依照JDK1.8来搞 –>

                <configuration>

                    <source>1.8</source>

                    <target>1.8</target>

                </configuration>

            </plugin>

        </plugins>

 

        <!– 仅声明子项目共有的插件,如果子项目需要此插件,那么子项目需要声明 –>

        <pluginManagement>

            <plugins>

                <!– 该插件用于将Scala代码编译成class文件 –>

                <plugin>

                    <groupId>net.alchim31.maven</groupId>

                    <artifactId>scala-maven-plugin</artifactId>

                    <version>3.2.2</version>

                    <executions>

                        <execution>

                            <!– 声明绑定到maven的compile阶段 –>

                            <goals>

                                <goal>compile</goal>

                                <goal>testCompile</goal>

                            </goals>

                        </execution>

                    </executions>

                </plugin>

 

                <!– 用于项目的打包插件 –>

                <plugin>

                    <groupId>org.apache.maven.plugins</groupId>

                    <artifactId>maven-assembly-plugin</artifactId>

                    <version>3.0.0</version>

                    <executions>

                        <execution>

                            <id>make-assembly</id>

                            <phase>package</phase>

                            <goals>

                                <goal>single</goal>

                            </goals>

                        </execution>

                    </executions>

                </plugin>

            </plugins>

        </pluginManagement>

想要了解跟多关于大数据培训课程内容欢迎关注尚硅谷大数据培训,尚硅谷除了这些技术文章外还有免费的高质量大数据培训课程视频供广大学员下载学习。


上一篇:
下一篇:
相关课程

java培训 大数据培训 前端培训 UI/UE设计培训

关于尚硅谷
教育理念
名师团队
学员心声
资源下载
视频下载
资料下载
工具下载
加入我们
招聘岗位
岗位介绍
招贤纳师
联系我们
全国统一咨询电话:010-56253825
地址:北京市昌平区宏福科技园2号楼3层(北京校区)

深圳市宝安区西部硅谷大厦B座C区一层(深圳校区)

上海市松江区谷阳北路166号大江商厦6层(上海校区)

武汉市东湖高新开发区东湖网谷(武汉校区)

西安市雁塔区和发智能大厦B座3层(西安校区)