我试图使用Maven (m2eclipse)建立一个项目,但我在Eclipse中得到这个错误:

Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem

什么好主意吗? 如果你能告诉我如何检查是否一切配置正常,那就太有帮助了。


当前回答

在我的例子中,我在spring工具4中得到了这个错误消息

ArtifactTransferException: org.codehaus.plexus:plexus-interpolation:jar:1.26 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-interpolation:jar:1.26 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org java.lang.reflect.InvocationTargetException

这是解决方案

步骤01 -首先关闭弹簧工具应用程序

步骤02 -进入路径C:\Users\User并删除。m2文件夹

步骤03 -现在去包探索和选择你的项目

第04步-现在右键单击您的项目,进入Maven,单击更新项目

如何卸载Spring Tool 4

步骤01 -单击帮助并转到关于Spring工具套件4

步骤02 -现在点击安装细节

步骤03 -在里面,你可以看到所有已安装的软件,只需按Ctrl + A选择所有,然后单击卸载

其他回答

对我来说,我只是在POM.xml文件中添加了下面的xml代码。在我右键单击项目-> Maven ->更新项目后,我检查了快照/发布的强制更新**,一切正常

    <dependencies>
        <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jstl/jstl -->
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

我的工作空间里只有几个项目也有类似的问题。其他具有几乎相同pom的项目根本没有错误。列出的其他答案都不能解决我的问题。我最终无意中为每个项目删除/重新应用Maven特性,错误消失了:

对于每个项目,有一个pom与“决议将不会被重新尝试…”错误:

在Eclipse中右键单击项目并选择Maven->Disable Maven Nature 右键单击Eclipse中的项目并选择Configure->Convert to Maven project

设置。xml代理? 在eclipse中有maven全局\本地配置文件,添加settings.xml

这对我来说在Windows上很管用:

找到{user}/.m2/存储库 在窗口右上方的搜索栏中,输入“.lastupdated”。Windows将在该目录下的所有子文件夹中查找这些文件。 删除所有的.lastupdated文件。 回到Eclipse,右键单击项目并选择Maven > Update project。 选择“强制更新快照/版本”。 单击Ok,依赖项最终将正确解析。

这件事也发生在我身上,对此你可能有两种解决办法

If your project consist of some external or project specificdependency in it then you have to manually add it to your M2 repo folder which is located at C:\Users\Mohit.Singh.m2\repository folder and then you have to run mvn eclipse:eclipse and then mvn clean install from the project folder if you do not have any wxternal or project sppecific dependency then you may import the project into eclipse as Existing maven project then right click on project --> GO to maven --> Click on update project a window will appear check the force snapshot download option and hit on OK