On Tuesday 22 August 2006 19:48, fagfa wrote:
> Thanks. But I do want to use "-D" to pass database variable since I also
> package for other databases, such as oracle, db2, psql, etc.
Then using the antrun plugin you could copy the file ${myname}.properties to 
META-INF and use the -D to give a value to myname.

> Alexandre Russel-2 wrote:
> > On Tuesday 22 August 2006 16:15, fagfa wrote:
> > I had the same problem testing ejb. The unit test where using toplink but
> > package needed to use jboss.
> > You could use mvn test, and then instead of using -Ddb=mysql, use the
> > antrun
> > plugin to copy mysq.properties into /META-INF and maybe delete the hsql
> > file.
> >
> >> Hi, I have a database specific resource file which needs to copy to
> >> "classes/META-INF" and as a result, package into the jar file, for
> >> example,
> >> hsql.properties, mysql.properties, etc. I specify this database property
> >> in
> >> POM, and default value is "hsql".
> >>
> >> The problem is that I only use hsql for my unit test. So if I just do
> >> "mvn
> >> test", it works perfectly. But if I do "mvn -Ddb=mysql package", I got a
> >> problem, apparently. mysql.properties is copied to "class/META-INF" and
> >> broke my unit tests, which are executed before package phase and using
> >> "hsql" database.
> >>
> >> Any suggestions? Thanks,

Attachment: pgpkcNDqETfEK.pgp
Description: PGP signature

Reply via email to