You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Newsgroup <ne...@burknet.ch> on 2006/12/28 23:44:47 UTC
META-INF directory for webapps not in classpath
hi maven-users
I've got the following problem: if I'm creating a webapp and put the META-INF directory into "src/main/webapp" the files in it (for example persistence.xml) are NOT on the classpath and therefore my tests are failing, I can't package my project.
if I'm putting the META-INF directory under "src/main/resources", the files are on the classpath, the tests succeed, the WAR file is built.
BUT: if I explode the WAR, my META-INF directory and it's files are under "/WEB-INF/classes/". strange place for META-INF, isn't it?
is it possible to have the files for the META-INF directory on the classpath and copy them on packaging into the correct location (for example "/META-INF/persistence.xml")?
thanks and greetings
stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: META-INF directory for webapps not in classpath
Posted by Markus Wolf <ma...@emedia-solutions-wolf.de>.
Hi,
> I've got the following problem: if I'm creating a webapp and put the META-INF directory into "src/main/webapp" the files in it (for example persistence.xml) are NOT on the classpath and therefore my tests are failing, I can't package my project.
>
having META-INF under src/main/resources should be ok.
The files in META-INF does not belong to the java classpath. In jar
files the classpath root contains the META-INF, but in webapps it
differs, since there are libs and classes but not the META-INF in the
classpath. But tools searching for META-INF should have access to it
knowing the locations above (e.g. TopLink Essentials is looking there
manually not using the classpath).
> if I'm putting the META-INF directory under "src/main/resources", the files are on the classpath, the tests succeed, the WAR file is built.
> BUT: if I explode the WAR, my META-INF directory and it's files are under "/WEB-INF/classes/". strange place for META-INF, isn't it?
>
> is it possible to have the files for the META-INF directory on the classpath and copy them on packaging into the correct location (for example "/META-INF/persistence.xml")?
>
Whats your pom.xml? Especially the part of the resource configuration?
(I think the defaults should be good enought for your requirements)
Markus Wolf
--
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>> web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>> pgp: http://wwwkeys.de.pgp.net
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [solved] META-INF directory for webapps not in classpath
Posted by Stefan Burkard <ne...@burknet.ch>.
hi maven-users
I've found the answer to my problem: I just searched the JPA-specs about the
location of persistence.xml and was quite surprised to read the following:
"The root of the persistence unit is the WEB-INF/classes directory; the
persistence.xml file is therefore contained in the WEB-INF/classes/META-INF
directory."
This means: placing the META-INF folder and the persistence.xml file under
"src/main/resources" so that it is copied to WEB-INF/classes is simply
correct behaviour.
Thanks anyway for your answers
Stefan
Stefan Burkard wrote:
>
> hi maven-users
>
> I've got the following problem: if I'm creating a webapp and put the
> META-INF directory into "src/main/webapp" the files in it (for example
> persistence.xml) are NOT on the classpath and therefore my tests are
> failing, I can't package my project.
>
> if I'm putting the META-INF directory under "src/main/resources", the
> files are on the classpath, the tests succeed, the WAR file is built.
> BUT: if I explode the WAR, my META-INF directory and it's files are under
> "/WEB-INF/classes/". strange place for META-INF, isn't it?
>
> is it possible to have the files for the META-INF directory on the
> classpath and copy them on packaging into the correct location (for
> example "/META-INF/persistence.xml")?
>
> thanks and greetings
> stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/META-INF-directory-for-webapps-not-in-classpath-tf2892575s177.html#a8085526
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [solved] META-INF directory for webapps not in classpath
Posted by Stefan Burkard <ne...@burknet.ch>.
Stefan Burkard wrote:
>
> hi maven-users
>
> I've got the following problem: if I'm creating a webapp and put the
> META-INF directory into "src/main/webapp" the files in it (for example
> persistence.xml) are NOT on the classpath and therefore my tests are
> failing, I can't package my project.
>
> if I'm putting the META-INF directory under "src/main/resources", the
> files are on the classpath, the tests succeed, the WAR file is built.
> BUT: if I explode the WAR, my META-INF directory and it's files are under
> "/WEB-INF/classes/". strange place for META-INF, isn't it?
>
> is it possible to have the files for the META-INF directory on the
> classpath and copy them on packaging into the correct location (for
> example "/META-INF/persistence.xml")?
>
> thanks and greetings
> stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/META-INF-directory-for-webapps-not-in-classpath-tf2892575s177.html#a8085462
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: META-INF directory for webapps not in classpath
Posted by Vinita Joshi <vj...@etouch.net>.
I have my files under src\main\application\META-INF. It is working fine for
me.
Vinita
-----Original Message-----
From: Newsgroup [mailto:newsgroup@burknet.ch]
Sent: Thursday, December 28, 2006 2:45 PM
To: users@maven.apache.org
Subject: META-INF directory for webapps not in classpath
hi maven-users
I've got the following problem: if I'm creating a webapp and put the
META-INF directory into "src/main/webapp" the files in it (for example
persistence.xml) are NOT on the classpath and therefore my tests are
failing, I can't package my project.
if I'm putting the META-INF directory under "src/main/resources", the files
are on the classpath, the tests succeed, the WAR file is built.
BUT: if I explode the WAR, my META-INF directory and it's files are under
"/WEB-INF/classes/". strange place for META-INF, isn't it?
is it possible to have the files for the META-INF directory on the classpath
and copy them on packaging into the correct location (for example
"/META-INF/persistence.xml")?
thanks and greetings
stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org