views:

69

answers:

1

New to appfuse - I like the concept.

I configured the username/password to the database in jdbc.properties.

It didn't work. So I also configured my credentials in pom.xml

Why is it so? Am I doing something wrong?

+1  A: 

You should leave the jdbc.properties file alone with its ${xxx} value placeholders. Maven will take the properties in your pom.xml and at compile time replace the ${xxx} in your jdbc.properties resource file with the proper values. This action of injecting property values into resource files is configured by setting filtering to true via

    <build>
 <resources>
  <resource>
   <directory>src/main/resources</directory>
   <filtering>true</filtering>
  </resource>
 </resources>

A general rule of thumb is to never have the same properties (or code, or data) in two different places. This duplication is almost always unnecessary and makes applications harder to maintain.

rcampbell