Announcement Announcement Module
No announcement yet.
Combine Roo in a Dynamic Web Project Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combine Roo in a Dynamic Web Project

    When i add Roo nature a to Dynamic Web Projet under STS all
    the roo process is broken due to dependencies errors.

    My final goal is to combine Roo with Spring Remote and i can
    even figure how.

    Roo is simply a astonishing tool but there's a lot to do for us
    to integrate and understand it.

    Thank you !

  • #2
    Which version of STS? We recommend using STS 2.3.1 which will automatically import Roo projects correctly when you use the "Import Existing Project" option. You shouldn't need to do anything beyond the import command.


    • #3
      I'm using the 2.3 but as i was doing before, creating the project using the Roo console and then import it does not mark the project as Dynamic Web but as a Java.

      My previous process was to export as War using Eclipse.

      How can i export my project as .war since perform package generate a jar ?

      I do really hope we can integrate Roo in our process.



      • #4
        I suspect you haven't installed a web controller yet.

        If you simply create a new project in Roo and add some entities, fields and tests, the pom.xml will specify the artifact type as JAR. Only when you first use a 'controller' command will the pom.xml be modified to make it a WAR. I'm guessing you imported the project before using 'controller'. Is that the case?

        If so I suggest using one of the 'controller' commands and then re-importing. It should come in as a WAR project and both 'perform package' and 'mvn package' will yield a .war file for you.


        • #5
          You are correct Ben that was the point.

          Our system is totally relying upon Spring Remote so Spring Web
          and controllers are not required.

          I only want to create the war archive containing the Spring App
          with no html at all.

          You have done a promising work at SpringSource by conceptualizing
          a tool like Roo. It's a great challenge to fit all required process to
          complete such a tool.

          'Merci' for taking the time to help us in the first steps

          Best Regards,


          • #6
            You've very welcome. We're happy to help you on your Roo journey, so don't hesitate to sing out if you need anything else.

            BTW I've created Jira issue to update the docs to explain this behaviour better. It's good receiving feedback like this, as it helps us identify areas we can improve the resources.


            • #7
              Indeed, Roo is initially generating a standard Java project (in pom.xml):

              It will only convert the project to a Web project when you start generating Web artifacts. I think this makes good sense but needs to be better documented.

              As a workaround you should be able to simply change the packaging in the project pom.xml:

              And then run 'perform eclipse' from Roo shell, or 'mvn eclipse:eclipse' from your normal shell. This should update the Eclipse/STS workspace artifacts and convert the project nature to a dynamic web project without the need to install any of the Roo web artifacts.



              • #8
                Originally posted by Ben Alex View Post
                Which version of STS? We recommend using STS 2.3.1
                Is there a version 2.3.1? I grabbed the Mac versions today and found only 2.3.0. If 2.3.1 is in beta, any timeframe on its release?




                • #9
                  Sorry, my mistake. STS 2.3.1 is very close, but 2.3.0 is the latest as of 13 Jan 10.


                  • #10
                    Want to use servlets without controllers

                    Hi Guys,
                    This post is almost same what I am looking for.

                    Only difference is I want to use Servlets (for GWT, Vaadin) only.
                    Without Controllers.
                    How to do that? and still able to add new model/domain classes with persistence using Roo afterward.



                    • #11
                      You can use a Roo controller command to install all the web tier requirements make make a quick MVC controller. Then delete the MVC controller but keep the web tier requirements (ie web.xml etc). From there you're free to use Roo to help with your entities, persistence etc, but use traditional GWT remoting techniques for accessing them from the client. Just be aware there are limitations in what will realistically work given the entities are not GWT serializable (ie they're not in the GWT "client" package).


                      • #12
                        Discrepancy in documentation

                        It is said in both documentation and forum entries that the reason that roo projects don't show up as wtp projects in eclipse is just that a controller hasn't been added and the packaging is still jar. I haven't found that at all. My project has controllers, is packaging as war. I have tried deleting it and reimporting it numerous times. It still wo n't show up as a wtp project so that I can run it on a tomcat server within eclipse.

                        What's up with this? Any hints?



                        • #13
                          Most likely this is because the Eclipse has not (yet) detected the project changes. Initially you created the project as jar type (so Eclipse does not apply the WTP project nature), then you created some controllers and the nature should have changed.

                          Can you try to refresh or do a Project > Clean? Another option is to delete the project in Eclipse (without deleting the project in your file system) and reimport it.


                          • #14

                            I've tried all that numerous times. Still didn't show up as a dynamic web project. Deleted it, reimported, refreshed. I ended up directly editing the .project file and reimporting it. That worked. It now shows up with dynamic web project settings. The question now is whether I can get it to actually deploy properly. It didn't work automatically the first time...

                            Thanks for your response.


                            • #15
                              It is probably best if you remove all settings files from your project then so they can be recreated. From there you have two options:

                              1. run 'mvn clean eclipse:eclipse' and then import as Java project
                              2. Import as maven project directly