我创建了一个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>
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.i尝试了一些so
similler问题,但这些与不同的事情有关。但是这个错误仍然存在.can你能帮我解决这个错误
答案 0 :(得分:1)
请确保将插件标签放在构建标签之间,如下所示:
<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>
如果你这样说并且问题仍然存在,那么显然这是一个连接问题。确保您有Internet连接,或者如果您在代理后面,请在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>