Results 1 to 3 of 3

Thread: development AND production profile

  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Default 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. #2
    Join Date
    Jun 2008
    Location
    Philadelphia, PA, USA
    Posts
    212

    Default

    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
    Ken Rimple
    Chariot Solutions
    email: krimple@chariotsolutions.com
    work: www.chariotsolutions.com/education
    personal: www.rimple.com

    Author: Spring Roo in Action (Manning)
    MEAP Site: manning.com/rimple

  3. #3
    Join Date
    Jan 2010
    Location
    Mislata - Valencia - Spain
    Posts
    162

    Default

    Quote 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 !
    Mario Martínez Sánchez
    Project Manager & Software Architect
    --------------------------
    Disid Technologies S.L.
    http://www.disid.com
    --------------------------
    gvNIX
    http://gvnix.googlecode.com
    http://www.gvnix.org

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •