두 손끝의 창조자

로컬 리포지토리 등록시 보안 오류 본문

패키지관리/Gradle

로컬 리포지토리 등록시 보안 오류

codinglog 2021. 8. 26. 16:14

로컬 네트워크에 설치한 넥서스 리포지토리를 사용하려고 아래와 같이 리포지토리를 등록하면

maven {
    url "http://10.110.1.12:8889/nexus/content/groups/public"
}

아래와 같은 오류를 볼 수 있다.

* What went wrong:
Execution failed for task ':compileJava'.
> Failed to notify dependency resolution listener.
   > Could not resolve all dependencies for configuration ':detachedConfiguration1'.
      > Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://10.110.1.12:8889/nexus/content/groups/public)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.1.1/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
   > Could not resolve all dependencies for configuration ':detachedConfiguration2'.
      > Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://10.110.1.12:8889/nexus/content/groups/public)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.1.1/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.

최신 그래들에서는 보안을 위해 http 서버를 사용하는 것을 허용하지 않고 있다. 강제로 http 서버를 사용가능하게 하려면

allowInsecureProtocol true

를 추가한다.

repositories {
    maven {
        url "http://10.110.1.12:8889/nexus/content/groups/public"
        allowInsecureProtocol true
    }
    mavenCentral()
}

 

반응형
Comments