java - spring工具套件插件执行未覆盖错误

标签 java eclipse spring maven spring-mvc

我创建了一个 spring mvc 项目。但是 eclipse sts 显示错误。我创建的每个项目都会显示此错误。 screenshot

pom.xml 的此标记中显示错误

 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

这是错误。 see image for clarify

Plugin execution not covered by lifecycle configuration: 
org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default-compile, phase: compile)

CoreException: Could not calculate build plan: Plugin 

org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies
 could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: 
ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-
-plugin:pom:2.5.1 from https://repo.maven.apache.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.5.1 from/to 
central (https://repo.maven.apache.org/maven2): Network is unreachable: connect

我对sts和maven都是新手。我不确定这与sts或maven相关。我尝试了一些so类似的问题,但这些问题与不同的事情有关。但是这个错误仍然会来。你能帮我解决这个错误

最佳答案

确保将插件标签放在构建标签之间,如下所示:

<build>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.5.1</version>
    <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <compilerArgument>-Xlint:all</compilerArgument>
        <showWarnings>true</showWarnings>
        <showDeprecation>true</showDeprecation>
    </configuration>
</build>

如果您这样说并且问题仍然存在,那么显然这是一个连接问题。确保您有互联网连接,或者如果您位于代理后面,请在 m2 目录中配置setting.xml,如下所示:

<proxies>
     <proxy> 
        <active>true</active>
         <protocol>http</protocol>
          <username>user</username> 
        <password>password</password> 
        <host>200.55.156.179(for example)</host> 
        <port>3128(for example)</port> 
        </proxy>

</proxies>

关于java - spring工具套件插件执行未覆盖错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37008034/

相关文章:

java - 为什么使用 void 方法打开文件打不开?

eclipse - 无法在 Eclipse 中安装 SVN 连接器

python - PyDev 控制台不打印所有级别的日志记录

spring - 带有 HSQLDB 的 Hibernate 4.1 给出 'data exception: string data, right truncation'

java - 使用 Spring 注入(inject)模板化集

java - 有没有办法强制Java从命名包中识别未命名包?

java - 一个 EJB bean 可以实现多个接口(interface)吗?

java - 在 Eclipse 中调试我的 Maven2 插件

java - 向 Eclipse 工具栏添加可调整大小的文本

java - PayPal SDK 从付款审核页面到个人资料页面