본문 바로가기
에러

[Spring] cvc-elt.1.a: Cannot find the declaration of element 'project'.

by joeun 2023. 10. 12.

✔ 문제 상황

STS에서 새 프로젝트 생성 후 pom.xml을 열었더니 다음과 같은 에러문구가 떴다.

*STS 버전: 4.20.0

 

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

 

에러 문구

Line 2. error

cvc-elt.1.a: Cannot find the declaration of element 'project'.

Line 3. error

Downloading external resources is disabled.

 

 

 


✔ 해결 방법

두 가지 방법 중 택1하면 된다.

 

방법 1. 링크 주소값 수정

https => http

xsi:schemaLocation 값 중 https에서 's'를 삭제하여 http로 수정해주면 에러 표시가 사라진다.

 

 

 

방법 2. 소스 강제 다운로드

에러 밑줄이 있는 곳에 마우스를 가져다 대면 해당 링크에서 강제 다운로드할 수 있는 안내창이 뜬다.

'Force download of...' 문구를 클릭해주면 링크 주소를 수정하지 않아도 에러 표시가 사라진다.

 

 

강제 다운로드 후

 

 


 

주소창에 http://maven.apache.org/xsd/maven-4.0.0.xsd 로 입력해도 https로 리다이렉션이 일어나는걸 보면 기본값인 https 주소가 맞는 것 같다. 해당 https 주소로 소스 강제 다운로드도 잘 됐고... 스택오버 플로우에서는 http인 상태에서 에러가 나 https로 변경하여 에러를 해결한 케이스도 여럿 있었다. 그런데 왜 https 주소를 disabled라고 인식할까...

 

 

 

 

 

 

👀 참고

 

Spring 스프링 pom.xml 오류해결 cvc-elt.1.a: Cannot find the declaration of element 'project'

프로젝트를 maven Update Project 하니까 pom.xml에서 아래의 오류가 계속 발생 cvc-elt.1.a: Cannot find the declaration of element 'project'. 위에 태그내용을 아래의 내용으로 수정하니깐 에러가 사라졌다. 차이는 ht

devmg.tistory.com

 

Why POM.xml default template has an error? cvc-elt.1.a: Cannot find the declaration of element 'project'

today I had fight with theoretically simple Maven. I did everything like in tutorial, but I had an issue: cvc-elt.1.a: Cannot find the declaration of element 'project'. Link to see template error I...

stackoverflow.com