Create Spring Boot Project With Android Studio

Step 1

Modify build.gradle

  1. Module Dir
1
2
3
4
5
6
7
8
9
apply plugin: 'org.springframework.boot'
apply plugin: 'java'


dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
compile 'org.springframework.boot:spring-boot-starter:2.3.4.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-web:2.3.4.RELEASE'
}
  1. Project Dir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Step 2

  1. Rename Res dir And create application.properties
  2. delete useless files

Step 3

  1. Create Boot Point Class DemoApplication.java

  2. Create Control

  3. Boot And Test

  4. Package Jar

本文为作者原创 转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

0%