提交 56eff32a 编写于 作者: W weixin_43814374

Auto Commit

上级 ce2ccbc7
run = "mvn -Dmaven.test.skip=true spring-boot:run"
run = "mvn clean package -Dmaven.test.skip=true -P dev;cd target;java -jar springboot-template*.jar"
language = "java"
[debugger]
......
......@@ -17,7 +17,7 @@
<packaging>jar</packaging>
<properties>
<java.version>17</java.version>
<java.version>1.8</java.version>
</properties>
<dependencies>
......@@ -41,32 +41,32 @@
</dependency>
<!--druid starter-->
<dependency>
<!-- <dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
</dependency> -->
<!--mysql-->
<dependency>
<!-- <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
</dependency>
</dependency> -->
<!--mybatis-->
<!--<dependency>
<!-- <dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.0</version>
</dependency>-->
</dependency> -->
<!--mybatis-plus-->
<dependency>
<!-- <dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.0</version>
</dependency>
</dependency> -->
<!--swagger3-->
<dependency>
......@@ -107,36 +107,35 @@
</build>
<profiles>
<!--开发环境-->
<!-- 开发环境 -->
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profileName>dev</profileName>
<spring.profiles.active>dev</spring.profiles.active>
</properties>
</profile>
<!--测试环境-->
<!-- 测试环境 -->
<profile>
<id>test</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<profileName>test</profileName>
<spring.profiles.active>test</spring.profiles.active>
</properties>
</profile>
<!--生产环境-->
<!-- 生产环境 -->
<profile>
<id>prod</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<profileName>prod</profileName>
<spring.profiles.active>prod</spring.profiles.active>
</properties>
</profile>
</profiles>
</project>
......@@ -3,7 +3,7 @@ package com.template;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication(scanBasePackages = {"com.skygod.base", "com.skygod.usermanagement"})
@SpringBootApplication(scanBasePackages = {"com.template"})
public class TemplateApplication {
public static void main(String[] args) {
......
......@@ -7,8 +7,9 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@MapperScan(basePackages = "com.template.*.mapper")
// 注意启动该配置项需要在pom中取消mybatisplusdruid等依赖的注释,同时必须配置数据源否则启动报错
// @Configuration
// @MapperScan(basePackages = "com.template.*.mapper")
public class MybatisPlusConfig {
@Bean
......
package com.template.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "测试服务")
@RestController
@RequestMapping("/test")
public class TestController {
@Value("${env}")
private String env;
@GetMapping("/getEnv")
@ApiOperation("查询当前环境")
public String getEnv(){
return env;
}
}
server:
servlet:
context-path: /dev
\ No newline at end of file
env: "开发环境"
\ No newline at end of file
server:
servlet:
context-path: /prod
\ No newline at end of file
env: "生产环境"
\ No newline at end of file
server:
servlet:
context-path: /test
\ No newline at end of file
env: "验收环境"
\ No newline at end of file
server:
port: 8081
\ No newline at end of file
port: 8081
servlet:
context-path: /springboot-template
spring:
# swagger配置
mvc:
pathmatch:
matching-strategy: ant_path_matcher
profiles:
active: @spring.profiles.active@
\ No newline at end of file
env: "开发环境"
\ No newline at end of file
env: "生产环境"
\ No newline at end of file
env: "验收环境"
\ No newline at end of file
server:
port: 8081
servlet:
context-path: /springboot-template
spring:
# swagger配置
mvc:
pathmatch:
matching-strategy: ant_path_matcher
profiles:
active: dev
\ No newline at end of file
artifactId=springboot-template
groupId=com.test
version=0.0.1-SNAPSHOT
com/template/config/SwaggerConfig.class
com/template/controller/TestController.class
com/template/TemplateApplication.class
com/template/config/WebMvcConfiguration.class
/root/springboot-template/src/main/java/com/template/config/WebMvcConfiguration.java
/root/springboot-template/src/main/java/com/template/config/SwaggerConfig.java
/root/springboot-template/src/main/java/com/template/controller/TestController.java
/root/springboot-template/src/main/java/com/template/TemplateApplication.java
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册