Type of Eclipse project for sample Spring project - eclipse

In a tutorial at http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html Spring guys didn't say which Eclipse project they choose to create this sample application. Project icon has S symbol over it, so this isn't a Java project (marked with J symbol).
However, it doesn't look like a Dynamic Web project either.
Could you please explain that S symbol and say which project type is it?

They are using the Spring Eclipse plugin (either that, or they are using the Springsource Tool Suite IDE, based on Eclipse)
With this plugin, a dynamic web project should get you the 'S' you are looking for.

The S just means that the Spring nature is active (and it's either Spring IDE or SpringSource Tool Suite). In Eclipse-speak, I guess you should generate a dynamic web project, but it would be better to generate a Maven Project and import that into Eclipse (then Eclipse will automatically set the correct project type).

Related

"Loader Constraint Violation" when converting Eclipse dynamic web project to Maven

I have created a simple dynamic web application in eclipse , Java web. And I have used Spring mvc architecture . The program is working fine it has a simple form handling function. Now i want to convert my project in to a Maven project but when I go Configuration->convert to maven, It gives me a "Loader Constraint Violation" error. I'm using Eclipse Luna.
maybe there is a problem with the maven plug-in you installed. try re install the plug-in and see

Maven Eclipse Integration

I have recently started out on Maven. I am trying to integrate Maven+eclipse(Juno)+tomcat7.
I have downloaded m2e-wtp plugin for eclipse and created a Maven project whose structure follows a standard Maven project structure. It is also configured a dynamic web project.
It is a multi module project with two modules of flex(f1 AND f2) and one module of webapp(w).I have configured all the plugins correctly and there is no problem with configuration of POMs.
What I want to achieve is :
When I clean and Build project in Eclipse using Project-->Clean,Eclipse does not build the war in target folder of my web application project (w). I also does not copy any of the flex resources to target folder. However,
When I run the project as maven build by right-clicking the web application project and running it as a "maven install" it creates everything as expected.
My question is that if it is possible to achieve what I mentioned in point (1)? Or the only correct way to do this is the way mentioned in point (2).
I am also not able to deploy the generted files in step 2 automatically in tomcat.
Do I need to use another maven plugin for this?
Please note that this i my first experience with Maven + eclispe. I have followed certain tutorials. So, Please be lenient while voting negatively.
From what I know it is not possible to force Eclipse to use Maven directly (I would gladly be proven wrong).
Eclipse does not use Maven to build (1). Using the m2e plugin, it is possible to run maven to perform the build as you discovered (2).
If you are looking for that kind of tight integration you can look at NetBeans or IntelliJ who are using Maven natively.
EDIT:
About (3) there is a Tomcat-Maven-Plugin that can deploy the WAR file created on a running tomcat instance. Check the Usage page for more details.

what's the difference between "dynamic web project" with JSF facet and "JSF project"?

When I install "web tools platform" plugins in Eclipse I have a new type of project I can create, called "dynamic web project". In such project I can add JSF facet and then use it to make JSF application.
But when I install "jboss tools" plugins I have a project type called just "JSF project".
What's the difference between both types of projects? Why have jboss tools people created their own type of JSF project?
Eclipse plugins are created to achieve some commonly used/desired configurations at much ease. As you said, you can create a Dynamic Web Prject and then perform couple of steps to convert/support JSF. JSF project is created with those required configuration already done for you.
Same example you can apply even between, a simple project(created though New -> General->Project option) and Dynamic Web Project i.e. you may create a simple project, create files/folders, update the class path etc manually and achieve the same which is directly available through Dynamic Web Project option. These plug-ins/options help you avoid several manual steps to reach a commonly desired functionality. JSF project is no exception.

Best practice for create web project in Eclipse/STS that supports maven and spring 3+

I recently completed the SpringCore training but never got this answer. I want to know the best possible way to create Dynamic Web Project in STS/Eclipse that supports Maven and Spring 3+
Is it to use the wizard and create a Dynamic Web Project then add Maven support and Spring Behavior?
Is it to use the wizard and create a Maven project and use archetype webapp then add Spring support?
Is it to use the wizard and create a Spring project add the Java EE project facet and Maven Support?
Is it something totally different?
I choose to create first dynamic web project, then add spring behavior and finally to build the project i am using maven.. which is really a powerfull tool.

What's the correct way to create a new Spring Roo Project with multiple maven modules?

How do I configure Spring STS to work with an existing multi-module Roo project or create a new one from scratch?
Let's take the first case: Creating the project outside of the STS with the Roo shell.
All I do is create the parent project and add a maven module to it. I have not setup JPA or created any entities.
When importing this kind of project (as an existing Maven project), Spring STS doesn't attach a Java project nature. As a result, I can't use the content-assist features of the IDE, or perform refactoring (STS complains the code isn't on the build path).
In the second case, I just want to create a new project from within the STS and start using Roo with multiple maven modules that will be created later.
When using the New Spring Roo Project wizard, I select the package type to be "POM" and let the wizard do it's job. However, errors are reported in the Problems view. STS is complaining it can't find the expected source folders (e.g., src/main/java ...).
Why is this so damn hard?
Thanks,
Jeff
Well I've been using Roo for a while and noticed the same anomalies you just reported. I didn't check your blog yet, but marked for further reading.
Anyway, for my multi-module projects, I usually create them inside or outside STS. Both resulting in the same problems you reported (#1 wrong parent project structure, not finding src, and #2 corrupting projects after importing as Maven projects).
First thing I'd like to clarify is that you don't have to run "perform eclipse" before importing a project into STS, or any Eclipse version with the Maven Plugin. The import will work (with previous flaws) just by the "Import Maven Project" option (and this is also explicitly written in Roo manual).
As for the issues we are talking about, well, I usually remove Roo nature from child projects' POM, to avoid opening Roo Shell (if it happens, Roo tend to delete some .aj files and, as you said, it will corrupt your project). Then I stick to Roo only by using inside the parent project, and then using the "module focus" command to work with child projects.
I believe Spring team will make everything works fine in due time, but for now, Roo is a great option and I believe those workarounds are worthy to keep using it inside Eclipse/STS.
Best regards,
Thiago Uriel
First of all, if you need to work with your Roo console based project in Eclipse - you need to run perform eclipse in your Spring Roo shell. Internally, it calls the Maven Eclipse Plugin and run mvn eclipse:eclipse to make sure your Maven project can be imported successfully to Eclipse / STS.
Related to the multi module projects, please see existing questions related to multi module projects on StackOverflow.
Cheers.