maven之‘settings.xml‘ has syntax errors

背景:
在springboot项目中拉取依赖,出现oracle对应的依赖不存在或没找到,如下所示:

之前一直使用阿里云 http://Maven.aliyun.com/nexus/content/groups/public/ maven仓库地址,拉去依赖的时候报错说没找到ojdbc6对应的 11.2.0.3版本。

<dependency>  
    <groupId>com.oraclegroupId>  
    <artifactId>ojdbc6artifactId>  
    <version>11.2.0.3version>  
    <scope>providedscope>  
dependency>

一、遇到的问题

'settings.xml' has syntax errors

二、解决方法

方法1:
删除maven仓库资源,例如:D:\Software\Maven\repository
更换为华为云的仓库

  
    huaweicloud
    central
    https://mirrors.huaweicloud.com/repository/maven/
  

然后重新拉取依赖

方法2:
需要注意settings.xml配置中格式问题,这个需要注意一下,例如:你可能在增加maven仓库地址时少引入单词或者引脚等

settings.xml配置






<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
  
  
  <localRepository>D:\Software\Maven\repositorylocalRepository>
  
  

  

  
  <pluginGroups>
    
  pluginGroups>

  
  
  <proxies>
    
  proxies>

  
  <servers>
    

    
  servers>

  
  <mirrors>
    
    
	
    




	  <mirror>
		   <id>huaweicloudid>
		   <mirrorOf>centralmirrorOf>
		   <url>https://mirrors.huaweicloud.com/repository/maven/url>
	  mirror>
  mirrors>

  
  <profiles>
  
   <profile>
		  <id>jdk-1.8id>
		  <activation>
			  <activeByDefault>trueactiveByDefault>
			  <jdk>1.8jdk>
		  activation>
		  <properties>
			  <Maven.compiler.source>1.8Maven.compiler.source>
			  <Maven.compiler.target>1.8Maven.compiler.target>
			  <Maven.compiler.compilerVersion>1.8Maven.compiler.compilerVersion>
		  properties>
      profile>
    

    
  profiles>

  
settings>

附件

参考:
intellij idea 新建springboot工程pom.xml报错
settings.xml‘ has syntax errors 解决办法
‘settings.xml‘ has syntax errors 解决办法

你可能感兴趣的:(Maven,maven,xml,java)