2

So some quick background information to describe my problem. I have a project named Pear that contains a basic Spring project, using Maven. I put this exact project into a SVN repository, and then imported it into this same Eclipse/STS instance under the name of SpringTestRepo.

The problem is, this imported repository contains no Run options that the one I created in Eclipse originally has. For example, in the Pear project, Run -> Run As gives the option to run on an embedded Tomcat server. In the SpringTestRepo project, I have no options - anything past Run As is greyed out.

Another thing that I'm having a problem with in the difference between the two projects is that the one I imported via SVN (SpringTestRepo) has no little 'S' or 'M' by the name of the project. It's also missing several handy annotations, such as a list of methods underneath my HomeController.java class.

Here is a picture to help illustrate my problem.

enter image description here

Any ideas as to how to resolve this issue?

Edit: Just to be clear, it's a little hard to see but just above the Pear project there is a little Maven 'M' and a little Spring 'S' symbol.

kibowki
  • 4,206
  • 16
  • 48
  • 74

2 Answers2

2

I believe I solved the problem! To anyone else importing an SVN project into their STS and having trouble getting it recognized as a Maven/Spring project (the little 'M' and 'S' next to the project name), follow these instructions.

First, to import from your SVN repo after the Subversive Eclipse plugin, click File -> Import -> SVN -> Project from SVN and then press next. Enter in your repository location - in my case, it was svn+ssh://user@domainIp.goes.here/home/user/SvnRepositories/SpringTestRepo. This location will be wherever you are serving your SVN repo from - the beginning of the URL could be svn+ssh, http, https, or several other options depending on how your SVN is set up. Click next, and then click Finish when it asks you which Revision you want to import (I'm importing HEAD, which is selected by default).

A new dialog will pop up, giving you four different choices in the form of radio buttons as to how you want to import your project.

enter image description here

Logically, I tried 'Check out as a project with the name specified'. This is what yielded the picture in my question - a project not associated with Maven. What you need to choose is 'Check out as a folder into existing project'. Exit these dialogs, and create a new Spring MVC Project that you will import that SVN project into. That is File -> New Spring Project -> Spring MVC Project. Once you have created this project, go back through the steps and import your SVN repo project into the project you just created.

This resolved the issue for me. Feel free to edit if I missed anything. Thanks

Community
  • 1
  • 1
kibowki
  • 4,206
  • 16
  • 48
  • 74
0

You need to create a new run configuration. Eclipse doesn't know how to run your web app for you hence why its greyed out.

Check out this for starters:
http://wiki.openkm.com/index.php/Configure_Tomcat_server_in_Eclipse http://www.codejava.net/frameworks/spring/spring-mvc-beginner-tutorial-with-spring-tool-suite-ide

Once you configure a server you can then select project to deploy to server and run.

Here is another good link to help you out run: http://www.deepakgaikwad.net/index.php/2009/02/08/spring-mvc-tutorial-with-eclipse-and-tomcat.html

Aeseir
  • 7,754
  • 10
  • 58
  • 107
  • Hi Aeseir. While this does solve the problem of the Tomcat server problem, I'm still having trouble converting the project into a Maven project. – kibowki Nov 07 '14 at 03:40
  • I'm assuming it has pulled it down into gradle, which means converting to maven. Use this answer as help http://stackoverflow.com/questions/12888490/gradle-build-gradle-to-maven-pom-xml – Aeseir Nov 07 '14 at 04:11