Announcement Announcement Module
Collapse
No announcement yet.
development AND production profile Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • development AND production profile

    I have experience with JBoss Seam. newly, moved to Spring Roo.
    One of the good features in Seam is to have development and production profiles.
    I used to keep the development db settings into the development profile.
    and save the production db settings in the production profile.
    It is easy to switch between them and create package for development and production.

    How I can do this in Roo??

  • #2
    Spring 3.1 has support for profiles. Check out this:

    http://java.dzone.com/articles/using...g-profiles-xml

    You can use a property to switch between them. Combine this with passing properties to Maven when you run the application or start your application server, and you should be good to go.

    Now, for apps in an enterprise, I'd suggest you consider the use of a JNDI datasource for your database connections, even if you're on Tomcat. You may not know this, but Tomcat supports JNDI resources for datasources and the like. That way, your database connection settings are in the app server, and aren't substituted for dev, test, production. You can use the Spring jee:jndi-lookup tag in your Spring config when getting the datasource.

    It would be nice to add Spring profile and environment support to Roo - consider that a JIRA to add if it isn't already in there. The tricky part if if you are using JNDI, when you run integration tests in JUnit you won't be on a container, so you'd need to swap out the JNDI datasource configuration XML for the datasource with one you create directly in your test XML. But that may be easy - simply have a jee:jndi-lookup for your dataSource for dev and production, and for testing, use a created datasource. You'd have to remember to run your tests with that profile, so that's where maybe Roo's automated testing commands will fall down.

    Ken

    Comment


    • #3
      Originally posted by krimple View Post
      It would be nice to add Spring profile and environment support to Roo
      Hi all !

      This is covered by Dynamic configuration (aka profiles management) addon from gvNIX team.

      More info at: http://code.google.com/p/gvnix/wiki/DocConfig

      Regards !

      Comment

      Working...
      X