You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeroen Dijkmeijer <je...@dijkmeijer.com> on 2009/05/08 17:57:17 UTC
duplicate entry error with maven eclipse and tomcat
> Hi,
>
> I'm working on a private/solo project and I've set up a project
> with maven on eclipse using the m2 plugin. A parent project and 2
> maven subprojects (modules?). 1 module is a spring project, the
> other a web project wicket.
> In the spring project I want to use profiles to dispatch the
> database configuration per environment (dev, tst, uat, prd)
> In all of the environments I need an file which i call
> application.properties and which is fed to a
> PropertyPlaceHolderConfigurer like:
> <bean id="propertyConfigurer"
> class
> =
> "org
> .springframework.beans.factory.config.PropertyPlaceholderConfigurer">
> <property name="location"
> value="classpath:application.properties" />
> </bean>
> apart from that I also want to unittest both projects (but starting
> with the spring project) so I also have testResources element in my
> pom, also containing the application.properties.
> The unittest are working fine, and I can successfully add the web
> project to a tomcat configuration in eclipse. However when I try to
> startup tomcat it fails telling me:
>
> Error creating zip file mypoll-domain.jar: duplicate entry:
> application.properties
> duplicate entry: application.properties
>
> I suspect it has to do with the testResources, commenting it out in
> the pom doesnt solve the problem however explicitly renaming the
> application.properties in the src/test/resource directory solves the
> problem (and brings me to the next file in line (hibernate.cfg.xml)
>
> Is there a way to solve this and prevent the test/resource's
> contents to appear on the tomcat project? Or is there something I'm
> completely overlooking and should I use other approaches?
>
> Any help is greatly appreciated.
> regards,
> Jeroen.
>
>
> PS I did check on google but I could not find any useful information.
> PPS versions:
> eclipse ganymede.
> java 1.5 (mac os x).
> m2 0.9.6.20080905
> maven version 2.0.9 (on the command line, and I hope eclipse is
> using the same version..?)
>