To answer your first question:

   mvn -Pprod jetty:run-war

prod is your profile name for the production branch.


To answer your second question: I'm not sure, because I did not try it.
But you could just set a property 

   <myVelocityDir>it/is/here</myVelocityDir>

and access it by ${myVelocityDir} where you need it. Maybe, someone else
can give you a better hint.

Sorry,
Martin




Tarjei Huse wrote:
> 
> Hi, 
> 
> Martin Homik wrote:
>> 
>> Change the the default database to hsqldb in the end of the pom:
>> 
>> 
>> <!-- Database settings -->
>> <dbunit.dataTypeFactoryName>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory</dbunit.dataTypeFactoryName>
>> <dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>
>> <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
>> <project.tmpdir>tmp</project.tmpdir>
>> <jdbc.groupId>hsqldb</jdbc.groupId>
>> <jdbc.artifactId>hsqldb</jdbc.artifactId>
>> <jdbc.version>1.8.0.7</jdbc.version>
>> <jdbc.driverClassName>org.hsqldb.jdbcDriver</jdbc.driverClassName>
>> <jdbc.url><![CDATA[jdbc:hsqldb:tmp/someDB;shutdown=true]]></jdbc.url>
>> <jdbc.username>sa</jdbc.username>
>> <jdbc.password></jdbc.password>
>> 
>> Add a profile for production use, such as:
>> 
>> <!-- ================= Production Settings Profile ================= -->
>> <!-- Use "-P prod" when you want to run production mode              -->
>> <!-- =============================================================== -->
>>     
>> This profile skips hibernate3, dbunit repopulation and the test plugins.
>> 
>> Hope, that helps.
>> 
> 
> It helps a lot. Just two extra questions. 
> 
> 1. How do I use the prod profile when I want to build a production war?
> Should I just run mvn war -P production ?
> 
> 
> 2. Also, I got a path I want to be able to configure. It is to a
> directory. The crux of the matter is that this directory will reside
> inside the project while I'm developing, but when I deploy the
> application, I want to be able to keep it outside the app. The directory
> contains a bunch of velocity templates and images.
> 
> Now, the question is: How do I set up spring so that I can provide the
> value either via maven or by configuring tomcat? Is there a common way to
> do this?
> 
> Kind Regards,
> Tarjei
> 
> 
> Tarjei Huse wrote:
>> 
>> Hi, I'm using Appfuse with hibernate and I want to run my
>> unit/integration tests in HSQLDB (or a different in-memory database) but
>> use mysql for my production environment as well as my staging
>> environment. 
>> 
>> Basically:
>> Run the test phase using HSQLDB, but switch to using mysql for mvn
>> jetty:run-war or mvn war -> but then with different username/password
>> configurations.
>> 
>> I would guess this is a quite common pattern, so how should it be done?
>> 
>> I've found some pointers, but I am not completely satisfied with them:
>> [1] shows how to configure Appfuse to use HSQLDB, but I cannot find where
>> the xml fragments should go. Also [2] discusses how to do this using
>> different profiles.
>> 
>> 1. http://thread.gmane.org/gmane.comp.java.appfuse.user/20476
>> 2. http://thread.gmane.org/gmane.comp.java.appfuse.user/28929/focus=29007
>> 
>> It seems to me that the best way would be if different profiles could be
>> activated for different phases (test, jetty:run-war) but that seems to me
>> not to be possible.
>> 
>> So, what is the best way to do this?
>> 
>> Kind regards,
>> Tarjei
>> 
>> 
>> 
>> 
> 
> 



-- 
View this message in context: 
http://www.nabble.com/Separate-database-settings-for-testing%2C-staging-and-production-tp19586169s2369p19626407.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to