原文见:https://blog.csdn.net/kikock/article/details/80466373
配置本地仓库
1
2
-
<mirror>
-
<id>alimaven
id>
-
<name>aliyun maven
name>
-
<url>http://maven.aliyun.com/nexus/content/groups/public/
url>
-
<mirrorOf>central
mirrorOf>
-
mirror>
-
<mirror>
-
<id>alimaven
id>
-
<mirrorOf>central
mirrorOf>
-
<name>aliyun maven
name>
-
<url>http://maven.aliyun.com/nexus/content/repositories/central/
url>
-
mirror>
-
-
<mirror>
-
<id>ibiblio
id>
-
<mirrorOf>central
mirrorOf>
-
<name>Human Readable Name for this Mirror.
name>
-
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/
url>
-
mirror>
-
<mirror>
-
<id>jboss-public-repository-group
id>
-
<mirrorOf>central
mirrorOf>
-
<name>JBoss Public Repository Group
name>
-
<url>http://repository.jboss.org/nexus/content/groups/public
url>
-
mirror>
-
-
<mirror>
-
<id>central
id>
-
<name>Maven Repository Switchboard
name>
-
<url>http://repo1.maven.org/maven2/
url>
-
<mirrorOf>central
mirrorOf>
-
mirror>
-
<mirror>
-
<id>repo2
id>
-
<mirrorOf>central
mirrorOf>
-
<name>Human Readable Name for this Mirror.
name>
-
<url>http://repo2.maven.org/maven2/
url>
-
mirror>
-
<build>
-
<plugins>
-
<plugin>
-
<groupId>org.apache.maven.plugins
groupId>
-
<artifactId>maven-compiler-plugin
artifactId>
-
<version>2.1
version>
-
<configuration>
-
<source>1.7
source>
-
<target>1.7
target>
-
configuration>
-
plugin>
-
plugins>
-
build>
然后重新update maven就可以解决该问题
修改maven配置文件
-
<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>
然后刷新
先右键项目 选择maven选项add plugin
搜索compiler 选最新的
然后强制更新项目
完整setting配置
1. 本地仓库路径由 .m2/repository 更改到E:\java\maven
2.增加国内镜像仓库2个
3.maven 编译器版本更改为javaSE-1.8
-
xml version="1.0" encoding="UTF-8" ?>
-
-
-
-
-
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
-
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation=
"http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
-
-
profiles>
-
-
-
settings>
-