我正试图掌握Spring,但考虑到3天之后我还没有设法运行一个简单的Hello World,它变得非常令人沮丧!示例
所以我从spring的showcase存储库(https://github.com/spring-projects/spring-mvc-showcase)下载了代码。接下来,我将其作为Maven项目导入Eclipse。单击“在服务器上运行”并选择Tomcat7,但我得到的只是“404:请求的资源不可用”错误。
我的pom.xml文件中也出现了2个错误:
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (execution: default, phase: process-sources)
和
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:test-compile (execution: default, phase: process-test-sources)
我做错了什么?
答案 0 :(得分:2)
...我得到的只是“404:请求的资源不可用”错误
您在浏览器中输入了什么网址? Eclipse控制台说什么错误?
对于Maven / M2E,您需要熟悉http://wiki.eclipse.org/M2E_plugin_execution_not_covered。然后,您需要在pom.xml
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>some-goal</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore /> or <execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>