복붙노트

[SPRING] 메이븐 (Maven)은 프록시 뒤에서 항아리를 다운로드하지 않습니다.

SPRING

메이븐 (Maven)은 프록시 뒤에서 항아리를 다운로드하지 않습니다.

Maven은 프록시 뒤에서 jar (s) (Dependency)를 다운로드 할 수 없습니다.

다음은 내 pom.xml입니다.

<?xml version="1.0" encoding="UTF-8"?>
<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 
    http://maven.apache.org/xsd/maven-4.0.0.xsd">

     <modelVersion>4.0.0</modelVersion>

<groupId>com.faizan.firstbootapp.group1</groupId>
<artifactId>com-faizan-firstbootapp-group-1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>FirstBootApp</name>
<description>Test app for Maven build system</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.2.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

</project>

다음은 C : \ Users \ faizanmubasher \ .m2 \ settings.xml 경로의 settings.xml입니다. 프록시를 추가했습니다.

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
 <proxies>
  <proxy>
    <id>skm--http-proxy</id>
    <active>true</active>
    <protocol>http</protocol>
    <host>my.proxy.ip.here</host>
    <port>8080</port>
    <username>faizanmubasher</username>
    <password>*****</password>
  </proxy>
  <proxy>
    <id>skm--https-proxy</id>
    <active>true</active>
    <protocol>https</protocol>
    <host>my.proxy.ip.here</host>
    <port>8080</port>
    <username>faizanmubasher</username>
    <password>*****</password>
  </proxy>
 </proxies>
</settings>

사용자 이름과 암호가 정확합니다.

jar 파일을 다운로드 할 수 없거나 구성해야하는 Maven 설정이 내 사무실의 프록시 때문입니까?

STS IDE에서이 오류가 발생했습니다.

The container 'Maven Dependencies' references non existing library 'C:\Users\faizanmubasher\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.0.2.RELEASE\spring-boot-autoconfigure-2.0.2.RELEASE.jar'    FirstBootApp        Build path  Build Path Problem

My Maven 버전은 Apache Maven 3.5.3입니다.

편집하다

MAVEN_OPTS = "- DhttpProxyHost = xxx.xx.xx.xx -DsocksProxyPort = 8080"명령 세트도 작동하지 않습니다.

해결법

  1. ==============================

    1.시도해보십시오. 1이 작동하지 않으면 2를 시도한 다음 3을 시도하십시오.

    시도해보십시오. 1이 작동하지 않으면 2를 시도한 다음 3을 시도하십시오.

    1) First update the project, Alt-F5
    
    2) Then go to your repo and blow away the directory for that dependency which should be in the directory C:\Users\faizanmubasher.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.0.2.RELEASE Then do an Alt-F5 again.
    
    3) If this fails try a mvn clean install -U from the command line.
    

    다음 명령을 사용하여 maven을 중앙 repo 연결에 테스트 할 수 있습니다.

    mvn archetype:generate
    

    2000 개 이상의 원형이 나타납니다.

  2. from https://stackoverflow.com/questions/50943317/maven-not-downloading-jars-behind-proxy by cc-by-sa and MIT license