< parent > < groupId>com.github.gantsign. parent </ groupId> < artifactId> java 8- parent </ artifactId> < version>INSERT VERSION HERE</ version> < re lative Path >
错误 信息: ‘ parent .re lative Path ’ of POM com.xxx:main:0.0.1-SNAPSHOT (D:\ItemProjects\IdeaProjects\xxx-server\main\pom.xml) points at com.niutrans:com.xxx.xxxserver instead of com.xxx:xxxserver, please verify your project structure xxx的 parent 里写的并不是xxx的上一级,而是继承了s
错误 描述: ‘ parent .re lative Path ’ of POM io.renren:renren-fast:3.0.0 (D:\IdeaProject\ java \gulimall\renren-fast\pom.xml) points at com.gulimall:gulimall instead of org.springframework.boot:spring-boot-starter- parent , please verify your project structure 将renr
1.利用开发工具(idea)自动导入 首先进入settings–》Appearance & Behavior–》System Settings–》Updates,将下面的Check pluginu for pdates的那一项的勾去掉,然后重启idea就可以了。
适合初学 springboot 的同学 --------------------------- maven 配置:pom.xml --------------------------- <?xml version="1.0"?> <project xsi:schemaLocation="http:// maven .apache.org/POM/4.0.0 http:// maven .apache.org/xsd/ maven -4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> < parent > <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter- parent </artifactId> <version>2.1.4.RELEASE</version> <re lative Path /> <!-- lookup parent from repository --> </ parent > <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>demo</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</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot- maven -plugin</artifactId> </plugin> </plugins> </build> </project> --------------------------- src/main/resources/application.yml --------------------------- spring: # 指定静态资源的路径 resources: static-locations: class path :/static/,class path :/views/ thymeleaf: prefix: class path :/templates/ server: port:8080 context- path :"/" --------------------------- DemoApplication 运行 main 方法即可启动 springboot --------------------------- package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages = {"com.example.*"}) //指定扫描包路径 public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); --------------------------- HelloWorldController --------------------------- package com.example.controller; import java .util.HashMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; // @RestController返回的是json @RestController public class HelloWorldController { // http://localhost:8080/hello 返回的是文本"Hello World" @RequestMapping("/hello") public String index() { return "Hello World"; * 本地访问内容地址 :http://localhost:8080/hello3 ;返回的是文本 @RequestMapping("/hello3") public String helloHtml(HashMap<String, Object> map) { map.put("hello", "欢迎进入HTML页面"); return "/index"; --------------------------- HelloWorldController --------------------------- package com.example.controller; import java .util.HashMap; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class SpringBootController { * 本地访问内容地址 :http://localhost:8080/hello2 ; 可访问到 * src/main/resources/views/index.html @RequestMapping("/hello2") public String helloHtml(HashMap<String, Object> map) { // 传参数hello到html页面 map.put("hello", "欢迎进入HTML页面"); return "/index"; --------------------------- src/main/resources/views/index.html --------------------------- <!DOCTYPE html> <meta charset="UTF-8"> <title>Insert title here</title> </head> aaaaaaaaaaaaaaaaaaaaaaacccccccccccccc <p th:text="${hello}">dddd</p> </body> </html> --------------------------- 直接访问静态页面 --------------------------- http://localhost:8080/index.html 可直接访问到 src/main/resources/templates/index.html
parent .re lative Path 报错 在子工程加上 <re lative Path >标签默认地址是…/pom.xml Maven 首先在构建当前项目的地方需找父工程的pom,其次在文件系统的这个位置(re lative Path 位置),然后是在本地仓库,最后在远程仓库寻找父工程的pom。 MyBatis使用分页插件pagehelper,遇到 IndexOutOfBoundsException: Index: 0, Size: 0] with root cause解决方法 Mysql报错ERROR [com.alibaba.druid.pool.DruidDataSource] - create connection error, url 我与代码: 看下mysql依赖版本是不是8.0以上,还需注意druid版本需求和mysql版本兼容 Mysql报错ERROR [com.alibaba.druid.pool.DruidDataSource] - create connection error, url 踉踉_跄: 我跟你一样的错误,请问你解决了吗 Mysql报错ERROR [com.alibaba.druid.pool.DruidDataSource] - create connection error, url lzy2633146990: 我本地数据库是8.0而且导入的包也是8.0还是一样出错 解决 Maven ‘parent.relativePath‘错误原因 yuxinById: 我这样设置后,子项目启动不了,失败是则么回事 IoC 和 AOP 概念讲解 马泽的未来: 这个图我看了还是有些懵逼