零基础myeclipse下springBoot+maven+thymeleaf的开发(1)
来源:互联网 发布:速达软件数据库密码 编辑:程序博客网 时间:2024/04/30 15:54
最近学习的springBoot,springBoot让我们开启了懒人模式,加上maven分分钟搭建好整个应用环境
下面来讲讲整个的开发流程:
1)myeclipse下创建maven项目:
首先new一个maven project,然后直接点击next(下图所示)
filter:webapp;选择webapp-javaee7(6也可以,最好和你的jdk对上);如下图所示
点击next,配置Group ID,和Artifact Id,随便输入都可以
生成目录如下:
接下来我们把缺的目录文件补上:新建一些source Folder(src/main/java放的是java文件,src/main/resources放的是一些资源文件,maven约定是这样的)
接下build path,把下面两个output修改成target/classes
这样我们就基本完成了项目的结构;
下来对springBoot所需要的依赖架包在pom.xml来添加:数据库的操作我用的是mybatis,所以我们把mybatis也一同依赖进去,整个文件如图所示:
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.cwh</groupId> <artifactId>springBoot2Maven</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.2.5.RELEASE</version> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <version.spring>3.2.9.RELEASE</version.spring> <version.jackson>2.4.4</version.jackson> <java.version>1.7</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.2.8</version> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-jdbc</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> <repositories> <repository> <id>spring-milestone</id> <url>https://repo.spring.io/libs-release</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>spring-milestone</id> <url>https://repo.spring.io/libs-release</url> </pluginRepository> </pluginRepositories></project>
保存后会自行更新项目,如果没有的话右击项目maven-》update project,这样maven注入的jar也就都添加进去了,可能有些人因为网络问题,可能存在更新后发现pom.xml文件有些地方还会报错,那么你就直接build path然后查看libraries的maven Dependencies,看哪些有错误的,你就去maven本地仓库把对应的jar包给删除掉,然后再update project。
未完待续。。。
0 0
- 零基础myeclipse下springBoot+maven+thymeleaf的开发(1)
- 零基础myeclipse下springBoot+maven+thymeleaf的开发(2)
- 零基础myeclipse下springBoot+maven+thymeleaf的开发(3) +mybaits
- 零基础myeclipse下springBoot+maven+thymeleaf的开发(4) 修改端口以及打包
- MyEclipse下搭建Maven管理的springboot项目
- SpringBoot+Thymeleaf+iBatis开发项目
- SpringBoot+Thymeleaf+iBatis开发项目
- SpringCloud零基础上手(二)——SpringBoot多模块maven项目
- SpringBoot16-springboot的Web开发-Spring Boot的Thymeleaf支持
- Springboot+maven+mysql+thymeleaf 简单框架搭建
- SpringBoot之thymeleaf(Q)
- SpringBoot学习笔记(四):整合thymeleaf遇到的问题
- java鬼混笔记:springboot之thymeleaf 1:简单的thymeleaf例子
- maven+Thymeleaf笔记-1
- SpringBoot--使用Thymeleaf模板开发web项目
- SpringBoot -- thymeleaf
- springboot-thymeleaf
- SpringBoot-thymeleaf
- 对任意10个随机数求和(3)
- swift 微信支付接口实现
- mongodb3.0.3集群分片搭建
- Android测试详解_1-Best Practices for Testing-介绍
- 正则表达式(适用于oracle及linux)
- 零基础myeclipse下springBoot+maven+thymeleaf的开发(1)
- 哈希表及哈希表查找相关概念
- 关于Xutils网络请求重试的问题
- openSession和getCurrentSession的比较
- scanf的注意点
- 实现简单输入支付密码的输入
- 第一个jdbc例子
- java实现敏感词过滤
- 对随机10个数求和(2)