所遇问题:
导入maven项目各个注解均报错了;
思考1:
这个项目使用了springboot;spring是个”大容器”,所有对象的创建和管理都交给了它, (SpringBoot是一个框架,一种全新的编程规范,他的产生简化了框架的使用,所谓简化是指简化了Spring众多框架中所需的大量且繁琐的配置文件,所以 SpringBoot是一个服务于框架的框架,服务范围是简化配置文件。
最明显的特点是,让文件配置变的相当简单、让应用部署变的简单(SpringBoot内置服务器,并装备启动类代码),可以快速开启一个Web容器进行开发。);先去查看springboot是否扫描到这些文件;
结果:查看配置文件XML以及各层的依赖,应该没出错。
思考2:
该导入的包是否成功导入?查看maven依赖树(mvn dependency),并检查依赖版本等是否有用;结果:应该没错,依赖树上显示了加入的jar包。
思考3:
有事问度娘;百度上的方法各异;我并没有成功,也许是我操作或者对它们的理解出了问题吧;决定问大佬,我问了大佬,大佬从事安卓开发多年,所以帮我叫来另一个大佬;在另一个大佬的指点下,
解决方案:
我先是去了本地仓库setting.xml下的镜像改为aliyun的镜像;(下图是查找你当前maven项目的本地仓库已经配置文件setting.xml的方法)
我这个是默认生成的,如果没有配置文件setting.xml;就自己新建一个;新建方法很多这里就不介绍了;附上我的setting.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration for a single
| user, and is normally provided in
| ${user.home}/.m2/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
| -s /path/to/user/settings.xml
|
| 2. Global Level. This settings.xml file provides configuration for all
| Maven users on a machine (assuming they're all using the
| same Maven installation). It's normally