相关疑难解决方法(0)

插件 'org.springframework.boot:spring-boot-maven-plugin:' 未找到

我是 Spring Boot 的新手,我打算将 h2 数据库与 maven 项目连接起来。这是我的 pom.Xml 文件。该文件给出了错误插件 'org.springframework.boot:spring-boot-maven-plugin:' not found

 <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.5.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>dev.che</groupId>
    <artifactId>stu</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>stu</name>
    <description>Demo project for Spring Boot</description>

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

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build> …
Run Code Online (Sandbox Code Playgroud)

java spring maven spring-boot

28
推荐指数
6
解决办法
5万
查看次数

插件org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT或其依赖项之一无法解析

我得到以下错误:

插件org.springframework.boot:spring-boot-maven-plugin:1.3.0.BUILD-SNAPSHOT或其依赖项之一无法解析:找不到工件org.springframework.boot:spring-boot-maven-plugin: jar:1.3.0.BUILD-SNAPSHOT

我的pom.xml文件是:

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.BBMSearchApp</groupId>
  <artifactId>adder</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>adder Maven Webapp</name>
  <url>http://maven.apache.org</url>
  
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.3.0.BUILD-SNAPSHOT</version>
	</parent>
  
  	<dependencies>
  		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<!-- <dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-mongodb</artifactId>
			<version>1.7.0.RELEASE</version>
		</dependency>
 -->
		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
        </dependency>
		
		<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>springloaded</artifactId> 
        </dependency>
        <!-- <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j</artifactId> 
        </dependency> -->
		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
   			<groupId>org.apache.tomcat.embed</groupId>
   			<artifactId>tomcat-embed-jasper</artifactId>
   			<scope>provided</scope>
		</dependency>
		
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20141113</version>
		</dependency>
		
		<dependency>  
      		<groupId>joda-time</groupId>  
      		<artifactId>joda-time</artifactId>  
		</dependency>
        
		<dependency>
        	<groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <!-- <dependency>
        	<groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-social-facebook</artifactId>
        </dependency> -->

        <!-- <dependency> …
Run Code Online (Sandbox Code Playgroud)

java eclipse spring spring-mvc maven

6
推荐指数
2
解决办法
2万
查看次数

Spring - 无法解析 MVC“查看”百里香叶

我得到了一个简单的HomeController.class

package com.example.tacos;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class HomeController {

    @GetMapping("/")
    public String home() {
        return "home";
    }
}
Run Code Online (Sandbox Code Playgroud)

我也有一个模板叫做 home.html

<!DOCTYPE HTML>
    <head>
    <title>Getting Started: Serving Web Content</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <p>Hey</p>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

无论如何,我在浏览器中得到 404,IDE 告诉我无法解析 MVC“视图”,正如您在屏幕上看到的那样

文件夹结构: 文件夹结构

浏览器: 浏览器

spring spring-mvc thymeleaf spring-boot

3
推荐指数
2
解决办法
5818
查看次数

标签 统计

spring ×3

java ×2

maven ×2

spring-boot ×2

spring-mvc ×2

eclipse ×1

thymeleaf ×1