pom.xml报错了,我和视频上代码一样,问题出在哪 求大神解决!!!

来源:3-5 Hello Spring MVC

梦想需要奋斗

2016-01-14 11:13

报错内容:Project build error: Non-resolvable import POM: Failure to transfer org.springframework:spring-framework-bom:pom:${spring-version} 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.springframework:spring-framework-bom:pom:${spring-version} from/to central (http://repo1.maven.org/maven2): IllegalArgumentException


代码:

<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 

http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.test</groupId>

<artifactId>Demo</artifactId>

<version>1.0-SNAPSHOT</version>

<name>Demo Maven Webapp</name>

<url>http://maven.apache.org</url>


<properties>

<commons-lang.version>2.6</commons-lang.version>

<slf4j.version>1.7.6</slf4j.version>

<spring.version>4.1.3.RELEASE</spring.version>

</properties>


<dependencyManagement>

<dependencies>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-framework-bom</artifactId>

<version>${spring-version}</version>

<type>pom</type>

<scope>import</scope>

</dependency>

</dependencies>

</dependencyManagement>

<dependencies>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-webmvc</artifactId>

</dependency>


<dependency>

<groupId>commons-lang</groupId>

<artifactId>commons-lang</artifactId>

<version>${commons-lang.version}</version>

</dependency>


<dependency>

<groupId>org.slf4j</groupId>

<artifactId>slf4j-log4j12</artifactId>

<version>${slf4j.version}</version>

<exclusions>

<exclusion>

<groupId>org.slf4j</groupId>

<artifactId>slf4j-api</artifactId>

</exclusion>

</exclusions>

</dependency>

</dependencies>

<!-- 集成jetty插件  -->

<build>

<plugins>

<plugin>

<groupId>org.eclipse.jetty</groupId>

<artifactId>jetty-maven-plugin</artifactId>

<version>9.2.2.v20140723</version>

</plugin>

</plugins>

</build>

</project>


写回答 关注

3回答

  • 慕莱坞8065122
    2016-10-17 16:09:08

    感谢楼主,实在不想敲


  • qq_唐敏卡_03145050
    2016-09-08 16:40:51

    楼主解决了吗???我也遇到相同的问题


  • zhengxueshi
    2016-01-14 23:30:50

    ${spring-version}改为 ${spring.version}

Spring MVC起步

Java中Spring MVC框架入门教程,快来看最易用的MVC框架

195972 学习 · 572 问题

查看课程

相似问题