我试图使用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

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


当前回答

谢谢你的回复,但经过更多的搜索,我能够解决这个问题。结果我不得不删除其中一个“*”。lastUpdated”,这是阻止我的一个插件(Maven Surefire插件)更新。我是手动清理的,因为清洁专家显然不会这么做。

问题是“*”。一个插件的lastUpdated文件阻止了maven检查更新,并且不允许下载必要的jar文件。

其他回答

当我在防火墙后面时,它发生在我身上。在Eclipse IDE中运行时,有时不会下载依赖项。确保使用mvn clean install -U来解决这个问题。在此之后,您将看到依赖项下载。

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

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

对我来说,我只是在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>

由于删除了'maven-compiler-plugin 2.0.2'而出现上述错误 来自maven存储库。 对我来说,当我将'maven-compiler-plugin'降级到2.0或2.0.1版本时,上述错误得到了解决。

我在Eclipse 3.6和m2eclipse中有类似的问题。

无法计算构建计划:未能将org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3从http://repo1.maven.org/maven2传输到本地存储库中,直到central的更新间隔已过或强制更新,才会重新尝试解决方案。原始错误:无法从中心转移工件org.apache.maven.plugins: Maven -resources-plugin:jar:2.4.3 (http://repo1.maven.org/maven2): ConnectException project1未知Maven问题

删除所有maven*。来自本地存储库的lastUpdated文件(正如Deepak Joy建议的那样)解决了这个问题。