首页 > 解决方案 > Maven Reimport IntelliJ 不工作无法将工件转移到中央存储库

问题描述

我将 maven settings.xml 更改为指向本地存储库,现在当我尝试删除本地存储库标记以指向默认的 .m2/repository 文件夹并在 intellij 上运行重新导入时,或者当我在本地项目上运行重新导入时存储库,我收到此错误:

无法将工件 org.kie:kie-ci:pom:7.41.0.Final 从/传输到中央(https://repo.maven.apache.org/maven2):连接到 127.0.0.1:8866 [/127.0. 0.1]失败:连接被拒绝

当我运行重新导入时,这个错误在我所有的项目中都存在。

这是我的 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
    </properties>

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

        <!-- https://mvnrepository.com/artifact/org.kie/kie-ci -->
        <dependency>
            <groupId>org.kie</groupId>
            <artifactId>kie-ci</artifactId>
            <version>7.41.0.Final</version>
        </dependency>


        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.6</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

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

</project>

这是我的设置。xml

<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <!--<localRepository>/Users/Eugene/drools/droolsEngine/dependencies</localRepository>-->
</settings>

请帮忙。谢谢

标签: javaspring-bootmavenintellij-ideapom.xml

解决方案


Check if proxy was not not configured on your PC accidentally. In my case proxy was configured by https://www.telerik.com/fiddler on port 8866. And I overlooked this fact.


推荐阅读