Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1-alpha-1
-
Fix Version/s: 2.1-alpha-2
-
Component/s: None
-
Labels:None
Description
My task is to include different context.xml to the META-INF directory of the resulting war file.
I provide default context.xml in the /src/main/webapp/META-INF and another in the /resources where "/" relates to the root of the project.
Example of directory structure and pom.xml in the attached context-bug.zip![]()
POM snippet with maven-war-plugin configuration:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <containerConfigXML>${basedir}/resources/context.xml</containerConfigXML> </configuration> </plugin>
Debug output of the mvn war:war:
{normat}[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1:war' -->
[DEBUG] (s) archiveClasses = false
[DEBUG] (s) cacheFile = E:\Work\Downloader\downloader-web\target\war\work\webapp-cache.xml
[DEBUG] (s) classesDirectory = E:\Work\Downloader\downloader-web\target\classes
[DEBUG] (s) containerConfigXML = E:\Work\Downloader\downloader-web\resources\context.xml
[DEBUG] (s) filters = []
[DEBUG] (f) outputDirectory = E:\Work\Downloader\downloader-web\target
[DEBUG] (f) primaryArtifact = true
[DEBUG] (s) project = MavenProject: ru.kck.downloader:downloader-web:1.0 @ E:\Work\Downloader\downloader-web\pom.xml
[DEBUG] (s) useCache = true
[DEBUG] (f) warName = downloader-web
[DEBUG] (s) warSourceDirectory = E:\Work\Downloader\downloader-web\src\main\webapp
[DEBUG] (s) webappDirectory = E:\Work\Downloader\downloader-web\target\downloader-web
[DEBUG] (s) workDirectory = E:\Work\Downloader\downloader-web\target\war\work
[DEBUG] – end configuration –
[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[downloader-web] in [E:\Work\Downloader\downloader-web\target\downloader-web]{normat}
And last note: /resources/context.xml copied to the META-INF of the target directory, but war file created without any context.xml in it`s own META-INF
Thanks for the test project. I tested this with 2.1-alpha-1 and that version is broken like you reported. Upgrading to 2.1-alpha-2 solved the problem.