Programming/JAVA

[eclipse/java/maven] maven 2 error with JAVA 1.7

Pendine 2021. 7. 7. 18:23
728x90
반응형

maven intall Error

java compail error

 

회사에서 받은 유지보수용 대상 프로그램의 코드를 받아서 컴파일을 시도했는데 오류가 발생하여

해결방법으로 알아낸 것을 작성한다.

 

===================================================

원인 : 프로젝트에서 사용하는

((이부분은 예상)maven 버전이 2.x 버전 & )프로젝트 컴파일시 사용하는 환경이 JRE or JDK 1.7

&

메이븐 관련 의존성 파일 다운시

백퍼센트 확률로 현시점에서 메이븐 컴파일이 오류 발생함.

 

오류 현상

현시점(20210707) 에서 메이븐에서 지원하는 프로토콜과 자바버전 1.7 이 호환되지 않음

=> 다운이 되지 않는다. 

그래서 JDK1.7로 설정된 프로젝트를 통해서

메이븐을 통해 의존성 주입을 통해서 다운받는 경로

(기본경로시 설정시)C:\Users\유저명\.m2\repository 하위에 경로에 실제로 다운받는 jar파일과 pom 파일은 없고

~~~~~~.lastUpdated

m2e-lastUpdated.properties

라는 약올리는것같은 파일만 생성되고 실제 파일은 다운받지 않고 끝난다.

======================================

 

 

 

문제의 프로젝트 명 우클릭

이를 해결하기 위해서 JDK, JRE 설정을 1.8이상으로 변경 후 메이븐 업데이트를 통해 해결할 수 있다.

 

Frist-------------------------------------

project name right click ->  build path -> configure build path

 

1. remove  jre 1.7

2. add Library.

 

ADD JRE

 

 

ADD YOUR JRE or JDK 1.8 ver -> finish

 

 

Second-------------------------------------------------------------

Your project name right cilck -> properties

Java Compiler -> check on the specific setting

 

check out  -> Use compliance from ~~

set to Compiler compliance level -> above than 1.7 

 

 

apply and close

이러면 끝

완성

컴파일 가능

 

초기에 세팅 이후 1.7 이하로 변경 후 다시 컴파일해도 문제가 없다.

각자 런타임 환경에 맞게 다시 복구해주자.

 

 

----------------------------------------------------------------------------------------------------------

처음 받고서 컴파일이 안되는걸 보고선 이런게 레거시 코드구나 싶었다.

 

이걸 해결하려고 메이븐을 이클립스가 아니라 직접 다운받아서 돌려보고

방화벽도 풀고

다해봤는데 기억 안나는 저 아래 사이트중 프로토콜이 다르고 1.7에서는 지원을 못한다는것을 보자마자 바로 시도하게됐다. 컴파일 안돼서 많이 당황했다.

 

 

아래의 글자들이 기적적으로 복붙이 안되는 현상으로 인해서

소스코드 입력 양식을 이용해 작성했다.

 

나와 같은 오류를 겪는 사람들 중

내가 작성한 방법대로 해결되지 않는 사람들에게 조금이라도 더 도움이 되길 바라며 

내가 구글링시 사용했던 키워드들과 그 결과로 참조했던 사이트들을 작성한다.

 

googling keyword & search result WebSite

 

Plugin org.apache.maven.plugins:maven-install-plugin:2.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.2: Could not transfer artifact org.apache.maven.plugins:maven-install-plugin:pom:2.2 from/to central (https://repo.maven.apache.org/maven2): Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException

https://allonsyit.tistory.com/13

 

[Maven 에러] maven warning failed to retrieve plugin descriptor -> 해결 openJDK cacert 인증서 문제 [+덤 SSLException]

굉장굉장 험난한 모험을 완주하고 나 같은 괴로움을 겪을 누군가를 위하여 기록을 남긴다 오늘 메이븐 프로젝트 clean과 install이 되지 않는 고통을 겪음.. 아래와 같은 WARNING이 미친듯이 뜨면서 ER

allonsyit.tistory.com

 

 

java.util.NoSuchElementException   Plugin org.apache.maven.plugins:maven-install-plugin:2.2

 

 

 

java.util.NoSuchElementException one of its dependencies could not be resolved

 

 

 

maven-install-plugin-2.2.pom
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.2/
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.2/maven-install-plugin-2.2.pom

 

 

 

surefire-junit4-2.12.4
https://mvnrepository.com/search?q=maven-surefire-plugin+2.12.4
https://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-junit4/2.12.4/surefire-junit4-2.12.4.pom

 


maven-surefire-plugin:2.12.4
https://lowell-dev.tistory.com/19
https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.12.4


 

access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory
https://history1994.tistory.com/53


 

Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory
https://velog.io/@kada/JAVA-7%EC%97%90%EC%84%9C-Maven-install-build-%ED%95%98%EA%B8%B0

 

 

eclipse set to runtime env java version
https://www.programmersought.com/article/57565190845/
https://stackoverflow.com/questions/13635563/setting-jdk-in-eclipse

 

 

Plugin org.apache.maven.plugins:maven-install-plugin:2.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.2: Could not transfer artifact org.apache.maven.plugins:maven-install-plugin:pom:2.2 from/to central (https://repo.maven.apache.org/maven2): Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
https://allonsyit.tistory.com/13


java.util.NoSuchElementException   Plugin org.apache.maven.plugins:maven-install-plugin:2.2


java.util.NoSuchElementException one of its dependencies could not be resolved


maven-install-plugin-2.2.pom
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.2/
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.2/maven-install-plugin-2.2.pom


surefire-junit4-2.12.4
https://mvnrepository.com/search?q=maven-surefire-plugin+2.12.4
https://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-junit4/2.12.4/surefire-junit4-2.12.4.pom


maven-surefire-plugin:2.12.4
https://lowell-dev.tistory.com/19
https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.12.4


access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory
https://history1994.tistory.com/53


Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory
https://velog.io/@kada/JAVA-7%EC%97%90%EC%84%9C-Maven-install-build-%ED%95%98%EA%B8%B0


eclipse set to runtime env java version
https://www.programmersought.com/article/57565190845/
https://stackoverflow.com/questions/13635563/setting-jdk-in-eclipse

 

728x90
반응형