为了账号安全,请及时绑定邮箱和手机立即绑定

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

报错内容: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 回答

感谢楼主,实在不想敲


0 回复 有任何疑惑可以回复我~

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


0 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

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

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信