회사/사내개발

maven build 실패, Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4

lowellSunny 2020. 9. 3. 11:17

오류메시지 전체내용은 아래와 같다.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project intra: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4 -> org.apache.maven.surefire:surefire-booter:jar:2.12.4: Failed to read artifact descriptor for org.apache.maven.surefire:surefire-booter:jar:2.12.4: Could not transfer artifact org.apache.maven.surefire:surefire-booter:pom:2.12.4 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

 

혼란스러웠지만 두려울 것 없다. 에러메시지를 차근차근 살펴봤더니 잘은 모르겠지만 maven-surefire-plugin 에 관련된 의존성 설정이 정확하지 않다고 하는 것 같다.

.. dependencies could not be resolved ..

pom xml에 의존성을 명시해주면 되는건가?

... 구글링 ING... 

 

	        <plugin>
	          <groupId>org.apache.maven.plugins</groupId>
	          <artifactId>maven-surefire-plugin</artifactId>
	          <version>2.19.1</version>
	        </plugin>

위와 같은 코드를 추가하라고 한다. pom.xml에 추가 후 build했더니 build 성공!