HIi, I try to figur开发者_如何转开发e out the best way to set up a fully functionally Spring MVC project for use in Eclipse.
What I did so far:
- Create new project with "New Project > Spring > Spring Project"
- Try "maven package" command from Eclipse's "Run as" button > Error
- Compile projext on command line using "mvn package"
- Drag-drop to Tomcat webapps folder.
Now I try to figure out answers to these questions:
- Eclipse shows a folder with "JS" as icon, but when I open it it shows the "src" and "target" folder, also with JS icon... What is that?
- is there a way to "click a button" in Eclipse an compile the project AND have it auto-deployed to my local/remote web server?
THX
For the second question:
If you have configured a Server in Eclipse (for example Tomcat), and added your Project to this Server, then it auto-deployes every change in your project to the server. (Sometimes this does not work 100% correct and you have to restart the server.)
If you need more functionality you can have a look at JRebel ( http://www.zeroturnaround.com/jrebel/ )
Added
If you Project is no Dynamic Web Project (this is if you create it as Spring Project), then you have to add the Dynamic Web Facet first.
- Project Properties/Project Facets/-> Convert to faceted from.../
- Select: Dynamic Web Project, and Java
Then you can add the project to your server.
精彩评论