Giter VIP home page Giter VIP logo

springboot-demo's Introduction

1. 项目已经实现的功能

  • 用户登录,注销, 添加用户,删除用户,查询用户,修改用户

2. 项目相关文档

  • /src/main/resources/相关文档

3. 运行和测试

3.1. 数据库配置

  • 运行时,修改application.ymlspring.profiles.active=dev
  • 测试时,修改application.ymlspring.profiles.active=test

3.2. 运行

  • 浏览器访问http://localhost:8090/index.html

4. 相关技术

  • Springboot
  • Mybatis
  • Vue.js

5. 补充:Maven迁移至Gradle(以gradle 4.9为例)

5.1. 安装gradle

https://gradle.org/install/#manually

5.2. 配置gradle环境变量

  • GRADLE_HOME=D:\develop\gradle-4.9
  • Path=...;%GRADLE_HOME%\bin

5.3. 命令行执行gradlew init初始化项目

5.4. 修改gradle构建脚本,以支持运行springboot项目

build.gradle

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'org.springframework.boot'

group = 'cn.sitedev'
version = '0.0.1-SNAPSHOT'

description = """springboot-demo"""

sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
	options.encoding = 'UTF-8'
}

buildscript {
    repositories {
 		mavenCentral()
    }
	dependencies {
	    classpath('org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE')
	}
}

// 用于解决执行gradlew build后,找不到mapper.xml文件的问题
processResources {
    from('src/main/java') {
        include '**/*'     // 导入里面的所有文件,也可以自定义正则表达式
        exclude "**/*.java" // 源码文件中.java 文件是不需要的
    }
}

repositories {
        
     maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version:'2.0.1.RELEASE'
    compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.46'
    compile group: 'org.mybatis.spring.boot', name: 'mybatis-spring-boot-starter', version:'1.3.2'
    compile group: 'cn.hutool', name: 'hutool-all', version:'4.0.9'
    compile group: 'commons-codec', name: 'commons-codec', version:'1.11'
    runtime group: 'org.springframework.boot', name: 'spring-boot-devtools', version:'2.0.1.RELEASE'
    testCompile group: 'junit', name: 'junit', version:'4.12'
    testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'2.0.1.RELEASE'
}

5.5. 命令行执行gradlew build构建项目

5.6. 命令行执行gradlew bootRun启动项目

springboot-demo's People

Contributors

mrp321 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.