首页 > 其他分享 >学习笔记——尚好房项目(项目介绍、环境搭建、配置依赖关系)

学习笔记——尚好房项目(项目介绍、环境搭建、配置依赖关系)

时间:2023-02-10 14:56:35浏览次数:57  
标签:web 项目 spring springframework 尚好 version org com 搭建

2023-02-10

一、项目介绍

1、介绍 

尚好房是一个二手房管理服务平台,开放优质资源和线上能力,聚合线上线下二手房产资源,打造一个全方位二手房服务生态市场,为消费者提供优质房产服务资源。

2、核心技术

(1)基础框架:ssm

(2)分布式框架:ssm + Dubbo + zk

(3)spring session redis 实现session共享

(4)图片服务器:七牛云

(5)后台管理权限控制:spring-security

(6)前端用户登陆判断:拦截器

(7)后台管理模块:Thymeleaf

(8)前端技术:Vue + Axios

3、项目模块

最终为分布式架构模块

(1)shf-parent:根目录,管理子模块:

①common-util:公共类模块

②model:实体类模块

③service:dubbo服务父节点

    service-acl:权限服务模块

 service-house:房源服务模块

 service-user:用户服务模块

 service-api:dubbo服务api接口

④web:前端(dubbo服务消费者)

    web-admin:后台管理系统

 web-front:网站前端

4、数据库

6、其他资源

实体类,工具类

二、环境搭建

1、创建idea项目,搭建父工程shf-parent

①打开idea,店家“create new project”,选择“maven”点击“next”。

 

 点击“finish”

②删除“src”文件夹

③忽略.idea

 

 2、搭建工具类common-util模块

①将鼠标停留在父工程的位置,右击“new module”,选择“maven”,点击“next”

 

点击“finish”

 ②在“shf-parent/common-util/src/main/java/com.hh”下创建两个文件夹“result”、“util”,将代码导入对应位置

3、搭建实体类模块model

①将鼠标停留在父工程的位置,右击“new module”,选择“maven”,点击“next”

 

点击“finish”

  ②在“shf-parent/model/src/main/java/com.hh”下创建两个文件夹“entity”、“vo”,将代码导入对应位置

4、搭建项目模块web-admin

同上

注意:

①web工程的打包方式是war包,需要在“shf-parent/web-admin/src/pom.xml”中的<project>内部添加打包方式

<!--    web工程的打包方式是war-->
    <packaging>war</packaging>

②在main下直接创建webapp/WEB-INF/web.xml

放置web.xml的约束

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <display-name>web</display-name>
</web-app>

 三、配置依赖关系

1、在“shf-parent/pom.xml”下的<project>中导入依赖

<properties>
        <java.version>1.8</java.version>
        <spring.version>5.2.7.RELEASE</spring.version>
        <thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
        <pagehelper.version>4.1.4</pagehelper.version>
        <servlet-api.version>2.5</servlet-api.version>
        <fastjson.version>1.2.29</fastjson.version>
        <mybatis.version>3.4.5</mybatis.version>
        <mybatis.spring.version>1.3.1</mybatis.spring.version>
        <mysql.version>8.0.18</mysql.version>
        <druid.version>1.1.12</druid.version>
        <commons-fileupload.version>1.3.1</commons-fileupload.version>
        <slf4j-version>1.7.30</slf4j-version>
        <logback-version>1.2.3</logback-version>
    </properties>

    <!-- 依赖管理 -->
    <dependencyManagement>
        <dependencies>
            <!-- SpringMVC相关 -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <!--spring封装的jdbc数据库访问-->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <!--Spring提供的对AspectJ框架的整合-->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aspects</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <!--用于spring测试-->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
            </dependency>

            <!--用于springMVC模板-->
            <dependency>
                <groupId>org.thymeleaf</groupId>
                <artifactId>thymeleaf-spring5</artifactId>
                <version>${thymeleaf.version}</version>
            </dependency>

            <!--mybatis的分页插件-->
            <dependency>
                <groupId>com.github.pagehelper</groupId>
                <artifactId>pagehelper</artifactId>
                <version>${pagehelper.version}</version>
            </dependency>
            <!-- Mybatis -->
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis</artifactId>
                <version>${mybatis.version}</version>
            </dependency>
            <!-- Mybatis与Spring整合所需要的jar包 -->
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis-spring</artifactId>
                <version>${mybatis.spring.version}</version>
            </dependency>
            <!-- MySql -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${mysql.version}</version>
            </dependency>
            <!-- 连接池 -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid</artifactId>
                <version>${druid.version}</version>
            </dependency>
            <!-- 文件上传组件 -->
            <dependency>
                <groupId>commons-fileupload</groupId>
                <artifactId>commons-fileupload</artifactId>
                <version>${commons-fileupload.version}</version>
            </dependency>

            <!-- fastjson -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>

            <!-- 日志 -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j-version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback-version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>${servlet-api.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- java编译插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

2、在“shf-parent/common-util/pom.xml”下的<project>中导入依赖

<dependencies>
        <!-- SpringMVC相关 -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <!--spring封装的jdbc数据库访问-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
        <!--Spring提供的对AspectJ框架的整合-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
        </dependency>
        <!--用于spring测试-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
        </dependency>

        <!--用于springMVC模板-->
        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf-spring5</artifactId>
        </dependency>

        <!--mybatis的分页插件-->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper</artifactId>
        </dependency>
        <!-- Mybatis -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
        </dependency>
        <!-- Mybatis与Spring整合所需要的jar包 -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
        </dependency>
        <!-- MySql -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <!-- 连接池 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
        </dependency>
        <!-- 文件上传组件 -->
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>

        <!-- fastjson -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>

        <!-- 日志 -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
    </dependencies>

3、在“shf-parent/web-admin/pom.xml”下的<project>中导入依赖

<dependencies>
        <dependency>
            <groupId>com.hh</groupId>
            <artifactId>common-util</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>com.hh</groupId>
            <artifactId>model</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.15.v20190215</version>
                <configuration>
                    <!-- 如果检测到项目有更改则自动热部署,每隔n秒扫描一次。默认为0,即不扫描-->
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <webAppConfig>
                        <!--指定web项目的根路径,默认为/ -->
                        <contextPath>/</contextPath>
                    </webAppConfig>
                    <httpConnector>
                        <!--端口号,默认 8080-->
                        <port>8000</port>
                    </httpConnector>
                </configuration>
            </plugin>
        </plugins>
    </build>

 

标签:web,项目,spring,springframework,尚好,version,org,com,搭建
From: https://www.cnblogs.com/isDaHua/p/17108404.html

相关文章

  • 项目管理精华-上
    前言:如何利用项目管理让工作更简单、出色、可控1.项目管理需要正确的思维方式、技能和工具你是一名非职业项目经理吗?在回答这个问题之前,请先思考一下什么是项目。项......
  • 项目搭建碰到java.lang.NoClassDefFoundError
    基本都是pom依赖包冲突导致的,可以这样来解决:找到pom.xml找到依赖项   一般ClassNotfound会给一个具体的类名。搜索这个类名,看是在那个pom里面。然后在pom依赖项......
  • Docker搭建本地仓库
    一、搭建本地私有仓库有时候使用DockerHub这样的公共仓库可能不方便,这种情况下用户可以使用registry创建一个本地仓库供私人使用,这点跟Maven的管理类似。使用私有仓库有......
  • 直播app开发搭建,vue使用js-file-download完成导出功能
    直播app开发搭建,vue使用js-file-download完成导出功能1.安装js-file-downloadnpminstalljs-file-download​2.引入对应的功能模块importfileDownLoadfrom'js-file......
  • Linux系统的web管理工具——webmin搭建
    (Linux系统的web管理工具——webmin搭建)一、webmin介绍Webmin是目前功能最强大的基于Web的Unix系统管理工具。管理员通过浏览器访问Webmin的各种管理功能并完成相应的管......
  • 互联网医院开发搭建|线上问诊APP开发方向
     随着互联网医院的兴起,很多的企业也想开发互联网医院系统,但是又不太了解,其实市场上的有很多做互联网医院开发的的公司,至于如何的选择,就要看您对谁的方案更感兴趣了,接下来......
  • 【实验】搭建NFS远程共享服务器
    一、准备这里使用一台Centos7.9的虚拟机进行构建。服务器IP:192.168.160.xx1二、NFS服务器配置1、安装NFS服务yum-yinstallrpcbindnfs-utils ......
  • 使用腾讯云对象存储搭建图床
    目录环境的准备PicGo安装PicGo(以Windows为例)安装webp插件COS对象存储开通COS创建存储桶创建API秘钥配置PicGo图床服务测试Typora使用图床总结平常在学习一些东......
  • Docker搭建LNMP+wordpress
    一、项目模拟1.项目环境公司在实际的生产环境中,需要使用Docker技术在一台主机上创建LNMP服务并运行Wordpress网站平台。然后对此服务进行相关的性能调优和管理工......
  • JSP WEB项目大文件上传下载解决方案
    ​ javaweb上传文件上传文件的jsp中的部分上传文件同样可以使用form表单向后端发请求,也可以使用ajax向后端发请求    1.通过form表单向后端发送请求     ......