构建Spring MVC应用程序时出错 [英] Error while building Spring MVC application

查看:131
本文介绍了构建Spring MVC应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Spring框架的新手.我的系统上安装了带有JDK 1.7的Spring Tool Suite版本3.1.0. 最近,我将一个预先构建的Spring MVC项目导入到我的IDE中,该项目已经在另一个系统上工作.但是,当我尝试构建它时,它出现以下错误:-

I am new at Spring framework. I have Spring Tool Suite Version 3.1.0 installed with JDK 1.7 on my system. Recently I imported into my IDE a pre-built Spring MVC project already working on another system. But when I am trying to build it, it is giving the following error :-

Errors occurred during the build. Errors running builder 'Maven Project Builder' on project 'vdm'. Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

Errors occurred during the build. Errors running builder 'Maven Project Builder' on project 'vdm'. Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

此外,当我检查Maven的生命周期映射时,它显示:-

Moreover, when I check Maven's Lifecycycle Mapping, it shows :-

我的环境配置为:-

我的pom.xml是:-

My pom.xml is :-

  <?xml version="1.0" encoding="UTF-8" ?> 
- <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.engineersindia</groupId> 
  <artifactId>vdsc</artifactId> 
  <name>abc</name> 
  <packaging>war</packaging> 
  <version>1.0.0-BUILD-SNAPSHOT</version> 
- <properties>
  <java-version>1.6</java-version> 
  <org.springframework-version>3.0.6.RELEASE</org.springframework-version> 
  <org.aspectj-version>1.6.9</org.aspectj-version> 
  <org.slf4j-version>1.5.10</org.slf4j-version> 
  </properties>
- <dependencies>
- <!--  Spring 
  --> 
- <dependency>
  <groupId>org.springframework</groupId> 
  <artifactId>spring-context</artifactId> 
  <version>${org.springframework-version}</version> 
- <exclusions>
- <!--  Exclude Commons Logging in favor of SLF4j 
  --> 
- <exclusion>
  <groupId>commons-logging</groupId> 
  <artifactId>commons-logging</artifactId> 
  </exclusion>
  </exclusions>
  </dependency>
- <dependency>
  <groupId>org.springframework</groupId> 
  <artifactId>spring-webmvc</artifactId> 
  <version>${org.springframework-version}</version> 
  </dependency>
- <!--  AspectJ 
  --> 
- <dependency>
  <groupId>org.aspectj</groupId> 
  <artifactId>aspectjrt</artifactId> 
  <version>${org.aspectj-version}</version> 
  </dependency>
- <!--  Logging 
  --> 
- <dependency>
  <groupId>org.slf4j</groupId> 
  <artifactId>slf4j-api</artifactId> 
  <version>${org.slf4j-version}</version> 
  </dependency>
- <dependency>
  <groupId>org.slf4j</groupId> 
  <artifactId>jcl-over-slf4j</artifactId> 
  <version>${org.slf4j-version}</version> 
  <scope>runtime</scope> 
  </dependency>
- <dependency>
  <groupId>org.slf4j</groupId> 
  <artifactId>slf4j-log4j12</artifactId> 
  <version>${org.slf4j-version}</version> 
  <scope>runtime</scope> 
  </dependency>
- <dependency>
  <groupId>log4j</groupId> 
  <artifactId>log4j</artifactId> 
  <version>1.2.15</version> 
- <exclusions>
- <exclusion>
  <groupId>javax.mail</groupId> 
  <artifactId>mail</artifactId> 
  </exclusion>
- <exclusion>
  <groupId>javax.jms</groupId> 
  <artifactId>jms</artifactId> 
  </exclusion>
- <exclusion>
  <groupId>com.sun.jdmk</groupId> 
  <artifactId>jmxtools</artifactId> 
  </exclusion>
- <exclusion>
  <groupId>com.sun.jmx</groupId> 
  <artifactId>jmxri</artifactId> 
  </exclusion>
  </exclusions>
  <scope>runtime</scope> 
  </dependency>
- <!--  @Inject 
  --> 
- <dependency>
  <groupId>javax.inject</groupId> 
  <artifactId>javax.inject</artifactId> 
  <version>1</version> 
  </dependency>
- <!--  Servlet 
  --> 
- <dependency>
  <groupId>javax.servlet</groupId> 
  <artifactId>servlet-api</artifactId> 
  <version>2.5</version> 
  <scope>provided</scope> 
  </dependency>
- <dependency>
  <groupId>javax.servlet.jsp</groupId> 
  <artifactId>jsp-api</artifactId> 
  <version>2.1</version> 
  <scope>provided</scope> 
  </dependency>
- <dependency>
  <groupId>javax.servlet</groupId> 
  <artifactId>jstl</artifactId> 
  <version>1.2</version> 
  </dependency>
- <!--  Test 
  --> 
- <dependency>
  <groupId>junit</groupId> 
  <artifactId>junit</artifactId> 
  <version>4.7</version> 
  <scope>test</scope> 
  </dependency>
- <dependency>
  <groupId>org.springframework.ldap</groupId> 
  <artifactId>spring-ldap-core</artifactId> 
  <version>1.3.1.RELEASE</version> 
  </dependency>
- <dependency>
  <groupId>org.springframework.security</groupId> 
  <artifactId>spring-security-core</artifactId> 
  <version>3.1.0.M2</version> 
  </dependency>
- <dependency>
  <groupId>org.springframework.security</groupId> 
  <artifactId>spring-security-ldap</artifactId> 
  <version>3.1.0.M2</version> 
  </dependency>
- <dependency>
  <groupId>commons-dbcp</groupId> 
  <artifactId>commons-dbcp</artifactId> 
  <version>1.4</version> 
  </dependency>
- <dependency>
  <groupId>displaytag</groupId> 
  <artifactId>displaytag</artifactId> 
  <version>1.2</version> 
  </dependency>
- <dependency>
  <groupId>org.codehaus.jackson</groupId> 
  <artifactId>jackson-mapper-asl</artifactId> 
  <version>1.5.3</version> 
  </dependency>
- <dependency>
  <groupId>org.hibernate</groupId> 
  <artifactId>hibernate-validator</artifactId> 
  <version>4.1.0.Final</version> 
  </dependency>
- <dependency>
  <groupId>cglib</groupId> 
  <artifactId>cglib</artifactId> 
  <version>2.2</version> 
  </dependency>
- <dependency>
  <groupId>net.sf.jasperreports</groupId> 
  <artifactId>jasperreports-fonts</artifactId> 
  <version>4.7.0</version> 
  </dependency>
- <dependency>
  <groupId>commons-digester</groupId> 
  <artifactId>commons-digester</artifactId> 
  <version>2.1</version> 
  </dependency>
- <dependency>
  <groupId>org.codehaus.groovy</groupId> 
  <artifactId>groovy</artifactId> 
  <version>1.7.11</version> 
  </dependency>
- <dependency>
  <groupId>net.sf.jasperreports</groupId> 
  <artifactId>jasperreports</artifactId> 
  <version>4.7.0</version> 
  </dependency>
- <dependency>
  <groupId>com.lowagie</groupId> 
  <artifactId>itext</artifactId> 
  <version>2.1.7</version> 
  </dependency>
  </dependencies>
- <build>
- <plugins>
- <plugin>
  <groupId>org.apache.maven.plugins</groupId> 
  <artifactId>maven-compiler-plugin</artifactId> 
- <configuration>
  <source>${java-version}</source> 
  <target>${java-version}</target> 
  </configuration>
  </plugin>
- <plugin>
  <groupId>org.apache.maven.plugins</groupId> 
  <artifactId>maven-war-plugin</artifactId> 
- <configuration>
  <warName>abc</warName> 
  </configuration>
  </plugin>
- <plugin>
  <groupId>org.apache.maven.plugins</groupId> 
  <artifactId>maven-dependency-plugin</artifactId> 
- <executions>
- <execution>
  <id>install</id> 
  <phase>install</phase> 
- <goals>
  <goal>sources</goal> 
  </goals>
  </execution>
  </executions>
  </plugin>
- <plugin>
  <groupId>org.apache.maven.plugins</groupId> 
  <artifactId>maven-resources-plugin</artifactId> 
  <version>2.5</version> 
- <configuration>
  <encoding>UTF-8</encoding> 
  </configuration>
  </plugin>
  </plugins>
  </build>
  </project>

即使我将项目导入为Maven项目,在检索清单后,也会出现以下错误:-

Even when I am importing the project as a Maven Project, after retrieving listings, it giving the following errors :-

推荐答案

能否在以下路径中检查文件夹的内容.

Can you check the contents of the folder in following path.

C:\Users\{your computer user name}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.5

如果找不到该文件夹​​或该文件夹中没有内容,则必须检查eclipse的代理配置,否则可能引用了错误的maven settings.xml文件.

If you didn't find this folder or there is no content there then you must check the proxy configurations of the eclipse or you might be referencing to a wrong settings.xml file of maven.

希望这对您有所帮助.

Hope this helps you.

这篇关于构建Spring MVC应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆