On 10/9/07, Florian Kirchhoff <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a question regarding the use of jdbc.properties. When I run my tests,
> I see that the placeholder values in src/test/resources/jdbc.properties get
> replacted with the values in pom.xml before the file is deployed to
> target/test-classes.

This is done by the "maven-resources-plugin", which isn't listed in
your pob.xml because it automatically runs in the process-resources
phase.

http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

If you look in pom.xml, you'll notice that filtering is on for
resources. The properties that are substituted are taken from the
<properties> section.

http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html

>
> But when I run the install goal, then src/main/resources/jdbc.properties
> doesn't get the same treatment and is just copied to target/classes as is.

That's strange - it should have the same behavior since the same
lifecycles are still fired.

>
> So I have a couple of questions:
> 1) What plugin is doing the substitution and why isn't it done for the main
> resources and/or install goal?
> 2) I want to use difference properties depending on the goal, what's the
> best way to do that?

You can use profiles or settings.xml to change the properties and
override the defaults. If you look in your pom.xml, there should be a
"prod" profile that you can use to specify your production database
settings. Here's more on profiles and settings.xml:

http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Hope this helps,

Matt

>
> In advance thank you for any help with these matters,
>
> FK
>
> I run AppFuse 2.0 on Windows XP with Maven 2.0.7.
> --
> View this message in context: 
> http://www.nabble.com/When-are-values-in-jdbc.properties-substituted--tf4595051s2369.html#a13118285
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
http://raibledesigns.com

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

Reply via email to