IDEA导入Springboot+Maven项目踩坑

1.导入的过程中提示这个,点击"Unmark All",把钩都去掉,不然导进去项目Maven失效
在这里插入图片描述
2.导入后,顶部栏没有执行的按钮
从springboot的执行类里面运行一下就有了。

3.Maven配置
把这三个配好,setting.xml里配置阿里云的地址,这样下载jar快。注意:IDEA2017只能用3.6.0一下的maven版本,3.6.3会报无法导入的错误。
在这里插入图片描述

在这里插入图片描述
4.IDEA提示:Unmapped Spring configuration files found.Please configure Spring facet
快捷键:ctrl+shift+alt+s,点击spring,点击加号,弹出来的窗口全打钩在这里插入图片描述
弹出来的窗口全打钩
在这里插入图片描述
5.Maven的setting.xml配置
配置本地仓库

<localRepository>D:/repository</localRepository>

配置阿里云仓库

<mirrors>
    <!-- 阿里云仓库 -->
	<mirror>
		<id>alimaven</id>
		<mirrorOf>central</mirrorOf>
		<name>aliyun maven</name>
		<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
	</mirror>
	
	 <!-- 中央仓库1 -->
	<mirror>
		<id>repo1</id>
		<mirrorOf>central</mirrorOf>
		<name>Human Readable Name for this Mirror.</name>
		<url>http://repo1.maven.org/maven2/</url>
	</mirror>

	<!-- 中央仓库2 -->
	<mirror>
		<id>repo2</id>
		<mirrorOf>central</mirrorOf>
		<name>Human Readable Name for this Mirror.</name>
		<url>http://repo2.maven.org/maven2/</url>
	</mirror>
  </mirrors>

配置JDK

<profiles>
<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>
</profiles>

猜你喜欢

转载自blog.csdn.net/Funky_oaNiu/article/details/111030378