-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Response inline.

Jamie Bisotti wrote:
> OK, JIRA issue was rejected; moving to the list.  Sorry for the long
> post.  First...what I think I need:
> 
> I'm looking for something like Spring's, PropertyPlaceholderConfigurer
> in pom.xml (or any other Maven config file).
> 

<snip/>

> 
> Second, why I think I need it:
> 
> My project uses a combination of Hibernate and JDBC, so we want to
> have a jdbc.properties file, which contains bare bones JDBC
> connection-related entries and a hibernate.properties file, which
> contains Hibernate-specific entries.  However, currently, I have my
> JDBC connection stuff duplicated in both because I can't figure out
> how to get Maven to do what I need.  If I put replaceable tokens in
> hibernate.properties, and turn on filtering in the resource element,
> can I guarantee that jdbc.properties will be read first and that token
> replacement values will be available?  I think the answer is "no". 
> Then, there are the DbUnit entries in project.properties that also
> need this same info; another duplicate?

First, have you considered what to do when your target environment
changes? You'll have to change all of these configurations anyway when
you move from LOCAL to DEVELOPMENT to STAGING to PRODUCTION and so
on...that may be a little outside the scope of the build, but it's
definitely something to consider.

As for DbUnit, can you not read the configuration from a test-resource
configuration file, rather than depend on a configuration stanza in the
POM? This would side-step the whole issue of interpolating non-standard
properties into the POM (though that's still desirable with system
properties, just hasn't been implemented yet).

Finally, what it seems like you need is a single source for these
configuration properties from which to spray them into the appropriate
resources for token replacement. What this would seem to translate into
is a new plugin which binds earlier in the build lifecycle than the
resources mojo, and which will define a set of filters for use by the
resources mojo. This would make your use case trivial, and would provide
you with an objective source for all your configuration information
without having to use one target file as the source for the rest...

Unfortunately, we haven't yet added support for this type of maven-2
usage, although it's planned (see MNG-193). Eventually, we'll have a
plugin that loads a set of filters either directly from configuration,
or else from a file...then those initialized filters will be passed into
the resources plugin, and you'll be able to filter all of your jdbc and
hibernate properties files from a single authoritative source file.

> 
> With Maven 1.x, I can put the enties in project.properties, and
> replaceable tokens in jdbc.properties and hibernate.properties (not
> sure what to do about the DbUnit entries also within
> project.properties), but my understanding is this file will not exist
> in M2.  Without it I will need to duplicate my JDBC connection related
> info pom.xml (I think; for a DbUnit plug-in), jdbc.properties, and
> hibernate.properties, or am I missing something?

see above.

- -john
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFCXCIgK3h2CZwO/4URAqNEAJ0Y1Ln94YCIfmUE98gCCQgHj0cG5gCfcoF/
zaX5H6qDgxeIOFTRXkDoOPo=
=ZC+V
-----END PGP SIGNATURE-----

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

Reply via email to