解决:IDEA创建SpringBoot项目时无法导入依赖问题
2020-04-20 12:53
3515 查看
解决:IDEA创建SpringBoot项目时无法导入依赖问题
1、问题
在创建SringBoot项目时候,无法正常导入依赖的jar包,错误显示如下:
“Project ‘org.springframework.boot:spring-boot-starter-parent:2.0.0.RELEASE’ not fond more…”
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.0.RELEASE</version> <relativePath/> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
2、 摸索思考
记得之前上课的时候用Eclipse 也有类似的问题 解决办法就是将版本降级,只有降级了,才能兼容当前使用工具或者JDK版本的一个环境, 但是尝试修改过后并没有什么卵用
查找网上类似文章解决办法说要添加maven的镜像,打开maven的setting.xml修改过后如下:
<mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> <mirror> <id>mirrorId</id> <mirrorOf>central</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://central.maven.org/maven2/</url> </mirror> </mirrors>
修改过后
依旧没有解决。
3、问题解决
多番摸索,尝试过后,无果,决定重置整个setting文件,把添加的镜像改成阿里的,成功,正确代码如下:
... <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile> <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> ...
成功自动导入jar包!是开心的哈哈哈
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- IDEA创建SpringBoot项目无法正常启动的问题解决方式及思想
- idea 打包Spring boot项目,解决检查数据库连接导致无法打包的问题
- 使用Maven创建SpringBoot项目时缺少jar包依赖导致SpringApplication无法引入问题
- 新建maven springboot项目遇到依赖jar包无法导入问题经验总结
- spring boot创建项目包依赖问题的解决
- 解决IDEA创建maven项目下载依赖超慢问题
- 关于idea无法导入maven项目以及选择pom文件next按钮无法点击的问题解决
- Idea 创建的 SpringBoot 1.5 项目打印Unregistering JMX-exposed beans on shutdown后自动退出解决办法
- 如何解决创建SpringBoot项目时pom.xml的首行出错的问题
- spring boot项目IDEA启动报错问题解决
- IDEA引MAVEN项目jar包依赖导入问题解决方法
- IntelliJ IDEA中Spring Boot项目使用spring-boot-devtools无法实现热部署/热更新的问题解决
- Springboot导入项目代码报红,错误: 找不到或无法加载主类,解决办法(如何导Springboot项目)
- IDEA引MAVEN项目jar包依赖导入问题解决
- IDEA引MAVEN项目jar包依赖导入问题解决
- IDEA建Boot项目无法连接https://start.spring.iona解决
- Intellij14创建Spring-Mybatis项目创(填)建(坑)记录,解决IDEA下找不到xml文件的问题
- springboot项目,使用idea整合oracle,导入依赖之后不能连接数据库
- IDEA创建Spring boot项目时各依赖的说明(Developer Tools篇)
- Maven项目中,关于Spring Boot 整合MyBatis时,Service层无法找到mapper接口的问题解决