You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jean Pierre URKENS <je...@devoteam.com.INVALID> on 2022/07/11 13:55:20 UTC
maven-war-plugin packagingExcludes not working
Dear all,
I am trying to exclude the resources under ‘src/main/resource/db/*’ from
being included in my war file any possible configuration of the
‘packagingExcludes ‘ config parameter seems to be ignored:
My plugin-configuration as reported during the run with debug option is:
[DEBUG]
-----------------------------------------------------------------------
[DEBUG] Goal: org.apache.maven.plugins:maven-war-plugin:3.3.2:war
(default-war)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>6.0.0-SNAPSHOT</Implementation-Version>
<Implementation-Build>${buildNumber}</Implementation-Build>
<Implementation-BuildDate>11/07/2022
13:34:24</Implementation-BuildDate>
</manifestEntries>
</archive>
<archiveClasses default-value="false"/>
<attachClasses default-value="false"/>
<classesClassifier default-value="classes"/>
<classesDirectory default-value="${project.build.outputDirectory}"/>
<escapedBackslashesInFilePath default-value="false"/>
<filteringDeploymentDescriptors default-value="false"/>
<includeEmptyDirectories default-value="false"/>
<outdatedCheckPath default-value="WEB-INF/lib/"/>
<outputDirectory default-value="${project.build.directory}"/>
<outputTimestamp default-value="${project.build.outputTimestamp}"/>
<*packagingExcludes>WEB-INF/classes/db/**/*.sql</packagingExcludes>*
<primaryArtifact default-value="true"/>
<project default-value="${project}"/>
<recompressZippedFiles default-value="true"/>
<resourceEncoding default-value="${project.build.sourceEncoding}"/>
<session default-value="${session}"/>
<skip default-value="false">${maven.war.skip}</skip>
<supportMultiLineFiltering default-value="false"/>
<useDefaultDelimiters default-value="true"/>
<useJvmChmod default-value="true"/>
<warName default-value="${project.build.finalName}">op</warName>
<warSourceDirectory default-value="${basedir}/src/main/webapp"/>
<warSourceIncludes default-value="**"/>
<webResources>
<resource>
<directory>src/main/config</directory>
<includes>
<include>log4j.properties</include>
</includes>
<targetPath>WEB-INF/classes</targetPath>
</resource>
</webResources>
<webappDirectory
default-value="${project.build.directory}/${project.build.finalName}"/>
<workDirectory default-value="${project.build.directory}/war/work"/>
</configuration>
I also tried specifying:
*<packagingExcludes>WEB-INF/classes/db</packagingExcludes>*
*<packagingExcludes>WEB-INF/classes/db**/***</packagingExcludes>*
But the generated war always includes the content of this folder. So how do
I prevent a resource folder to be included in the generated war file.
RE: maven-war-plugin packagingExcludes not working
Posted by Jean Pierre URKENS <je...@devoteam.com.INVALID>.
Yes, this worked!
Thanks.
-----Original Message-----
From: Scott Kurz <sk...@gmail.com>
Sent: maandag 11 juli 2022 19:10
To: Maven Users List <us...@maven.apache.org>
Subject: Re: maven-war-plugin packagingExcludes not working
I tried this which seems to work:
<packagingExcludes>WEB-INF/classes/db/**</packagingExcludes>
though without tracking down the source or doc to understand why. Maybe
that helps though.
On Mon, Jul 11, 2022 at 9:56 AM Jean Pierre URKENS
<je...@devoteam.com.invalid> wrote:
> Dear all,
>
>
>
> I am trying to exclude the resources under ‘src/main/resource/db/*’
> from being included in my war file any possible configuration of the
> ‘packagingExcludes ‘ config parameter seems to be ignored:
>
>
>
> My plugin-configuration as reported during the run with debug option is:
>
> [DEBUG]
> ----------------------------------------------------------------------
> -
>
> [DEBUG] Goal: org.apache.maven.plugins:maven-war-plugin:3.3.2:war
> (default-war)
>
> [DEBUG] Style: Regular
>
> [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
>
> <configuration>
>
> <archive>
>
> <manifest>
>
>
> <addDefaultImplementationEntries>true</addDefaultImplementationEntries
> >
>
> </manifest>
>
> <manifestEntries>
>
> <Implementation-Version>6.0.0-SNAPSHOT</Implementation-Version>
>
> <Implementation-Build>${buildNumber}</Implementation-Build>
>
> <Implementation-BuildDate>11/07/2022
> 13:34:24</Implementation-BuildDate>
>
> </manifestEntries>
>
> </archive>
>
> <archiveClasses default-value="false"/>
>
> <attachClasses default-value="false"/>
>
> <classesClassifier default-value="classes"/>
>
> <classesDirectory default-value="${project.build.outputDirectory}"/>
>
> <escapedBackslashesInFilePath default-value="false"/>
>
> <filteringDeploymentDescriptors default-value="false"/>
>
> <includeEmptyDirectories default-value="false"/>
>
> <outdatedCheckPath default-value="WEB-INF/lib/"/>
>
> <outputDirectory default-value="${project.build.directory}"/>
>
> <outputTimestamp default-value="${project.build.outputTimestamp}"/>
>
> <*packagingExcludes>WEB-INF/classes/db/**/*.sql</packagingExcludes>*
>
> <primaryArtifact default-value="true"/>
>
> <project default-value="${project}"/>
>
> <recompressZippedFiles default-value="true"/>
>
> <resourceEncoding default-value="${project.build.sourceEncoding}"/>
>
> <session default-value="${session}"/>
>
> <skip default-value="false">${maven.war.skip}</skip>
>
> <supportMultiLineFiltering default-value="false"/>
>
> <useDefaultDelimiters default-value="true"/>
>
> <useJvmChmod default-value="true"/>
>
> <warName default-value="${project.build.finalName}">op</warName>
>
> <warSourceDirectory default-value="${basedir}/src/main/webapp"/>
>
> <warSourceIncludes default-value="**"/>
>
> <webResources>
>
> <resource>
>
> <directory>src/main/config</directory>
>
> <includes>
>
> <include>log4j.properties</include>
>
> </includes>
>
> <targetPath>WEB-INF/classes</targetPath>
>
> </resource>
>
> </webResources>
>
> <webappDirectory
> default-value="${project.build.directory}/${project.build.finalName}"/
> >
>
> <workDirectory default-value="${project.build.directory}/war/work"/>
>
> </configuration>
>
>
>
> I also tried specifying:
>
>
> *<packagingExcludes>WEB-INF/classes/db</packagingExcludes>*
>
> *<packagingExcludes>WEB-INF/classes/db**/***</packagingExcludes>*
>
>
>
> But the generated war always includes the content of this folder. So
> how do I prevent a resource folder to be included in the generated war
> file.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: maven-war-plugin packagingExcludes not working
Posted by Scott Kurz <sk...@gmail.com>.
I tried this which seems to work:
<packagingExcludes>WEB-INF/classes/db/**</packagingExcludes>
though without tracking down the source or doc to understand why. Maybe
that helps though.
On Mon, Jul 11, 2022 at 9:56 AM Jean Pierre URKENS
<je...@devoteam.com.invalid> wrote:
> Dear all,
>
>
>
> I am trying to exclude the resources under ‘src/main/resource/db/*’ from
> being included in my war file any possible configuration of the
> ‘packagingExcludes ‘ config parameter seems to be ignored:
>
>
>
> My plugin-configuration as reported during the run with debug option is:
>
> [DEBUG]
> -----------------------------------------------------------------------
>
> [DEBUG] Goal: org.apache.maven.plugins:maven-war-plugin:3.3.2:war
> (default-war)
>
> [DEBUG] Style: Regular
>
> [DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
>
> <configuration>
>
> <archive>
>
> <manifest>
>
>
> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
>
> </manifest>
>
> <manifestEntries>
>
> <Implementation-Version>6.0.0-SNAPSHOT</Implementation-Version>
>
> <Implementation-Build>${buildNumber}</Implementation-Build>
>
> <Implementation-BuildDate>11/07/2022
> 13:34:24</Implementation-BuildDate>
>
> </manifestEntries>
>
> </archive>
>
> <archiveClasses default-value="false"/>
>
> <attachClasses default-value="false"/>
>
> <classesClassifier default-value="classes"/>
>
> <classesDirectory default-value="${project.build.outputDirectory}"/>
>
> <escapedBackslashesInFilePath default-value="false"/>
>
> <filteringDeploymentDescriptors default-value="false"/>
>
> <includeEmptyDirectories default-value="false"/>
>
> <outdatedCheckPath default-value="WEB-INF/lib/"/>
>
> <outputDirectory default-value="${project.build.directory}"/>
>
> <outputTimestamp default-value="${project.build.outputTimestamp}"/>
>
> <*packagingExcludes>WEB-INF/classes/db/**/*.sql</packagingExcludes>*
>
> <primaryArtifact default-value="true"/>
>
> <project default-value="${project}"/>
>
> <recompressZippedFiles default-value="true"/>
>
> <resourceEncoding default-value="${project.build.sourceEncoding}"/>
>
> <session default-value="${session}"/>
>
> <skip default-value="false">${maven.war.skip}</skip>
>
> <supportMultiLineFiltering default-value="false"/>
>
> <useDefaultDelimiters default-value="true"/>
>
> <useJvmChmod default-value="true"/>
>
> <warName default-value="${project.build.finalName}">op</warName>
>
> <warSourceDirectory default-value="${basedir}/src/main/webapp"/>
>
> <warSourceIncludes default-value="**"/>
>
> <webResources>
>
> <resource>
>
> <directory>src/main/config</directory>
>
> <includes>
>
> <include>log4j.properties</include>
>
> </includes>
>
> <targetPath>WEB-INF/classes</targetPath>
>
> </resource>
>
> </webResources>
>
> <webappDirectory
> default-value="${project.build.directory}/${project.build.finalName}"/>
>
> <workDirectory default-value="${project.build.directory}/war/work"/>
>
> </configuration>
>
>
>
> I also tried specifying:
>
> *<packagingExcludes>WEB-INF/classes/db</packagingExcludes>*
>
> *<packagingExcludes>WEB-INF/classes/db**/***</packagingExcludes>*
>
>
>
> But the generated war always includes the content of this folder. So how do
> I prevent a resource folder to be included in the generated war file.
>