You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gabriel MirĂ³ <gs...@gmail.com> on 2013/08/01 18:19:55 UTC
Maven war has META-INF folder in two places
Hello,
I'm working on a project which uses JAAS and unfortunately for me Tomcat
requires a file to be put in a META-INF folder in the root of the war
app.war
|__META-INF
| |___context.xml
...
I think that it's already weird since the default META-INF location for
WAR's is in the classes folders.
app.war
|__WEB-INF
| |__classes
| |__META-INF
...
I'm using Maven, which states that anything in
src/main/resources/META-INF will be copied to the appropriate place,
which it does. What I'm trying to figure is whu it is also creating a
META-INF folder in the root of the file structure leaving me with 2
META-INF folders.
Project Structure
app
|__src/main/java
|__src/main/resources
| |__META-INF
| |__context.xml
...
After mvn package
app
|__META-INF [1]
|__WEB-INF
| |__classes
| |__META-INF [2]
| |__context.xml
...
So, if the war standard states that META-INF should be under classes
folder, as in #2, why maven war creates the #1 folder. And is there a
way to make it copy files into that folder instead of #2?
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven war has META-INF folder in two places
Posted by Michael-O <19...@gmx.net>.
Am 2013-08-01 18:19, schrieb Gabriel MirĂ³:
> Hello,
>
> I'm working on a project which uses JAAS and unfortunately for me Tomcat
> requires a file to be put in a META-INF folder in the root of the war
>
> app.war
> |__META-INF
> | |___context.xml
> ...
>
> I think that it's already weird since the default META-INF location for
> WAR's is in the classes folders.
>
> app.war
> |__WEB-INF
> | |__classes
> | |__META-INF
> ...
>
> I'm using Maven, which states that anything in
> src/main/resources/META-INF will be copied to the appropriate place,
> which it does. What I'm trying to figure is whu it is also creating a
> META-INF folder in the root of the file structure leaving me with 2
> META-INF folders.
>
> Project Structure
>
> app
> |__src/main/java
> |__src/main/resources
> | |__META-INF
> | |__context.xml
> ...
>
> After mvn package
>
> app
> |__META-INF [1]
> |__WEB-INF
> | |__classes
> | |__META-INF [2]
> | |__context.xml
> ...
>
> So, if the war standard states that META-INF should be under classes
> folder, as in #2, why maven war creates the #1 folder. And is there a
> way to make it copy files into that folder instead of #2?
There is a quirks here:
JAR: META-INF always goes into src/main/resources
WAR: META-INF always goes into src/main/webapp
There is no WAR META-INF in the classpath but in the ServletContext
ResourceLoaderPath only.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org