Spring + Spring MVC + Mybatis 云笔记项目(一)项目搭建

    xiaoxiao2022-06-30  174

    开发工具:eclipse + navicat 

    项目源码:下载地址

    Github:Github源码地址

    一、新建 maven 项目

    File -> New -> Project -> Maven -> Maven Project

    Next -> create s simple project  -> next

     

     填写项目基本信息 -> Finish

     

    项目目录

    二、添加项目需要的Jar包

    打开项目根目录下面的 pom.xml ,切换到  pom.xml Tab 页,

    将以下内容复制进 文件中

    <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.1.8.RELEASE</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.6</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.25</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.3.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>4.1.8.RELEASE</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.2.3</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.2.3</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.2.3</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.0</version> </dependency> </dependencies>

    保存文件后项目会自动下载相关的Jar包,并保存在电脑上,其它项目可直接添加Dependencies,不会重复下载。如下截图已经添加了相关jar包的引用

     打开 index.jsp  -> 右键 debug on server (tomcat server已添加) 出现以下界面表示项目搭建完成并运行成功


    最新回复(0)