-1

I'm trying to get to grips with Spring but it's getting quite frustrating considering that after 3 days I still haven't managed to run a simple Hello World! example.

So I downloaded the code from spring's showcase repository (https://github.com/spring-projects/spring-mvc-showcase). Next I imported it into Eclipse as a Maven project. Clicked on "run on server" and selected Tomcat7 but all I got was a "404:The requested resource is not available" error.

I also get 2 errors in my pom.xml file:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (execution: default, phase: process-sources)

and

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:test-compile (execution: default, phase: process-test-sources)  

What am I doing wrong?

spacitron
  • 2,095
  • 7
  • 30
  • 39
  • possible duplicate of [How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds](http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin) – Konstantin Yovkov Nov 24 '13 at 22:22
  • This question asks two questions at once, one of which (the m2e related one) has been solved elsewhere, and one of which (the 404) seems unsolved. This makes question and answer hard to read, and hence less useful for other. So, don't ask multiple questions at once. – oberlies Jan 10 '14 at 09:43

1 Answers1

2

...all I got was a "404:The requested resource is not available" error

What URL did you type in the browser? What does the Eclipse console say, any errors?

As for Maven/M2E, you need to familiarize yourself with http://wiki.eclipse.org/M2E_plugin_execution_not_covered. Then you need to add something like this to your 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>
Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
  • That worked, thanks. What I don't understand is, isn't the code supposed to work out of the box? Also, if spring is supposed to "make development easier" how come it's so difficult to find error-free examples to learn from? – spacitron Nov 24 '13 at 22:31
  • This particular error is specific to this this particular combination of project, eclipse, and maven. If you download the source and build from the command line - the lowest common denominator - everything should work out of the box. If it doesn't, that is a big problem and the maintainers should be notified (or you should fix and submit a pull request). That happened to me last week and I raised an issue for the project on github. In a matter of hours it was fixed. – Jason Nov 25 '13 at 13:50