【Java】SpringBoot入门级问题,缺少什么配置没法运行,求帮我改一下

项目地址

https://github.com/wohuifude1...

package com.mvc;

@SpringBootApplication

public class Application {

public static void main(String[] args) {

SpringApplication.run(Application.class, args);

}

}

【Java】SpringBoot入门级问题,缺少什么配置没法运行,求帮我改一下

<?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.business</groupId>

<artifactId>spring-boot-01</artifactId>

<version>1.0-SNAPSHOT</version>

<parent>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-parent</artifactId>

<version>1.5.9.RELEASE</version>

</parent>

<properties>

<java.version>1.8</java.version>

</properties>

<dependencies>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-web</artifactId>

</dependency>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>3.8.1</version>

</dependency>

<!-- Spring Boot JDBC -->

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-jdbc</artifactId>

</dependency>

<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->

<dependency>

<groupId>com.google.code.gson</groupId>

<artifactId>gson</artifactId>

<version>2.8.2</version>

</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-web</artifactId>

</dependency>

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-activemq</artifactId>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-beans</artifactId>

</dependency>

</dependencies>

<!-- maven打包时应用 -->

<build>

<plugins>

<plugin>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-maven-plugin</artifactId>

</plugin>

</plugins>

</build>

</project>

【Java】SpringBoot入门级问题,缺少什么配置没法运行,求帮我改一下
【Java】SpringBoot入门级问题,缺少什么配置没法运行,求帮我改一下
【Java】SpringBoot入门级问题,缺少什么配置没法运行,求帮我改一下

回答

pom文件 添加依赖
有的时候会报异常. 说jar和jar不知道用哪个.建议重启idea. 或电脑.....

<parent>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-parent</artifactId>

<version>1.4.0.RELEASE</version>

</parent>

<properties>

<java.version>1.8</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-activemq</artifactId>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-beans</artifactId>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-beans</artifactId>

</dependency>

</dependencies>

【Java】SpringBoot入门级问题,缺少什么配置没法运行,求帮我改一下
把这个依赖注释,然后update project就可以了,因为添加了这个依赖就需要在配置文件中配置数据库信息

你maven配置用的是默认的吧,jar包没下载下来?翻墙或者国内镜像

以上是 【Java】SpringBoot入门级问题,缺少什么配置没法运行,求帮我改一下 的全部内容, 来源链接: utcz.com/a/89411.html

回到顶部