Hi!

Am Freitag, 5. Februar 2010 08:41:02 schrieb Søren Krogh Neigaard:
> I have this in my settings.xml
>
> <settings>
>   <profiles>
>     <profile>
>       <activation>
>         <activeByDefault>true</activeByDefault>
>       </activation>
>       <properties>
>         <database.driver>oracle.jdbc.driver.OracleDriver</database.driver>
>         <database.url>jdbc:oracle:thin:@myhome:1521:orcl</database.url>
>         <database.username>foo</database.username>
>         <database.password>bar</database.password>
>       </properties>
>     </profile>
>   </profiles>
> </settings>
>
> And I have tried with these in my pom.xml:
>
> <properties>
>   <db.driver>oracle.jdbc.OracleDriver</db.driver>
>   <db.url>${database.url}</db.url>
>   <db.username>${database.username}</db.username>
>   <db.password>${database.password}</db.password>
> </properties>
>
> And this:
>
> <properties>
>   <database.driver>oracle.jdbc.OracleDriver</database.driver>
>   <database.url>dummy</database.url>
>   <database.username>dummy</database.username>
>   <database.password>dummy</database.password>
> </properties>
>
> I still get null with System.getProperty

Sorry, I missed one important point: you have to "export" your properties to 
become system properties. Do this by configuring the surefire plugin as 
described here:
http://maven.apache.org/plugins/maven-surefire-plugin/examples/system-properties.html

I just double checked it, this way it works.

hth,
- martin

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to