According to Maven's documentation here 
http://maven.apache.org/pom.html#Properties, this should work (I didn't 
try it):

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>

pom.xml:

<properties>
  <db.driver>oracle.jdbc.OracleDriver</db.driver>
  <db.url>${settings.database.url}</db.url>

I don't know if the profile comes into play in this case or if the whole 
path is needed like 'settings.profiles.profile....'. Just try it.

Bernd


Søren Krogh Neigaard <[email protected]> wrote on 
05.02.2010 08:47:04:

> [image removed] 
> 
> RE: Read properties from pom.xml from Java
> 
> Søren Krogh Neigaard 
> 
> to:
> 
> Maven Users List
> 
> 05.02.2010 08:47
> 
> Please respond to "Maven Users List"
> 
> But I do use the @Before annotation, and I was planning to call my 
> database cleanup from here. But my problem is that the database 
> properties are not accessible to me (I think), and they are managed 
> by maven (are they not?).
> 
> Med venlig hilsen / Kind regards 
> 
> 
> Søren Krogh Neigaard
> Systems Engineer
> 
> Søren Frichs Vej 39, 8000 Aarhus C
> Denmark 
> 
> Mobile +4541965252
> [email protected]
> www.systematic.com


InterComponentWare AG:  
Vorstand: Peter Kirschbauer (Vors.), Jörg Stadler / Aufsichtsratsvors.: Prof. 
Dr. Christof Hettich  
Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 351761 / 
USt.-IdNr.: DE 198388516  

Reply via email to