Follow by Email

Monday, July 9, 2012

Can't get basic Hello World Spring MVC project to work , Spring MVC Project , Maven: Failed to retrieve plugin descriptor error

Ok after banging my head with STS for 1 day I finally found the easy way to configure spring mvc project in STS.

 Below is the summary of easy steps to do

1) Download latest STS and install it
2) Configuring JDK and other things is easy so do that along with the wizard
3) Open STS select File --> New --> Other --> Spring Source Tool Suite --> Spring Template project --> Spring MVC Project and follow the Wizard to create a new project
4) Once it's done you will see STS showing you errors in the project code , and that is because the Maven dependencies are not downloaded yet.
5) Right click on the project select  run --> Maven Clean and then right click again on the project select run--> Maven install
If this step shows you error in console while running Maven then you have to do following steps

a) In STS click on windows --> Preferences --> General --> Maven --> Installations --> look at the folder where maven is being installed on my machine it is on

D:\Users\sajjadparacha\Downloads\springsource\apache-maven-3.0.3

b) open the Maven folder and go to conf folder , open settings.xml file and add below proxy setting xml

<proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>userName</username>
      <password>password</password>
      <host>proxy address</host>
      <port>80</port>
    </proxy>   

c) Don't forget to mention your user name , password and proxy address and save the settings.xml file.

6) Now come back to STS , right click on the project and select run --> Maven Clean and then run --> Maven Install . Now if your proxy settings are correct STS should build and install your project correctly and will download all the dependencies.
7) Right Click on your project and select run--> on server and you should see the Hello world page.

I wish this will help some one some day out there :).
Would be happy to have comments if you find it helpful or if you want to suggests any changes.



No comments:

Post a Comment