3

I am using eclipse to try to run a simple project here. When I typed contents in eclipse, it says: The type javax.validation.Payload cannot be resolved. It is indirectly referenced from required .class files. In the example shown there, he used maven and in my practice I haven't.

I also have maven plugin in eclipse m2e-wtp latest and kepler version of eclipse. I tried many websites, such as this one. Here he used command window and used some commands, but when I tried in my pc, it didn't work. I think maven needs to set in my environment variable. That means I have to install maven in my c:/programfiles or any.

Is there a way to run the commands in eclipse(naive)? can some one give me a link to build sample maven project using m2e eclipse?

4

1 回答 1

6

我下载了应用程序,它在我的电脑上运行良好。我所做的只是解压缩并输入:

mvn clean tomcat:run-war

我认为您可能缺少传递依赖项(Maven 将自动下载),请确保您在 eclipse 类路径中拥有所有这些:

$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SpringMVC Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ SpringMVC ---
[INFO] com.mkyong.common:SpringMVC:war:1.0-SNAPSHOT
[INFO] +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
[INFO] |  \- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
[INFO] |     \- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
[INFO] \- org.hibernate:hibernate-validator:jar:4.2.0.Final:compile
[INFO]    +- javax.validation:validation-api:jar:1.0.0.GA:compile
[INFO]    \- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.132s
[INFO] Finished at: Wed Sep 04 22:07:24 CDT 2013
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------

我的猜测是这个罐子:

javax.validation:validation-api:jar:1.0.0.GA:compile
于 2013-09-05T03:10:50.063 回答