maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barrie Treloar <baerr...@gmail.com>
Subject Re: Exclusing JSP files from war file
Date Wed, 16 Jan 2013 23:08:24 GMT
On 17 January 2013 09:20, anjibman <anjibcs@hotmail.com> wrote:
> Hi All,
>
> I have all JSP files in \views and subfolders as following:
>
> src\main\webapp\WEB-INF\views\error.jsp
> src\main\webapp\WEB-INF\views\mobile\home.jsp
> src\main\webapp\WEB-INF\views\mobile\register\register.jsp
> src\main\webapp\WEB-INF\views\normal\home.jsp
> src\main\webapp\WEB-INF\views\normal\register\register.jsp
>
> I am trying to exclude all these JSP from WAR file so I have plugin define
> in pom.xml as
> <plugin>
>    <groupId>org.apache.maven.plugins</groupId>
>    <artifactId>maven-war-plugin</artifactId>
>    <configuration>
>      <webXml>${basedir}/target/jspweb.xml</webXml>
>      <warSourceExcludes>**/*.jsp</warSourceExcludes>
>    </configuration>
> </plugin>
>
> But I can still see all JAR files in WAR file. Can any one tell me what I am
> doing wrong? Am I not writing path expression correctly? If so what will be
> correct pattern for such.
>

I dont do war stuff so I'm just pointing at the docs here.
Have you read http://maven.apache.org/plugins/maven-war-plugin/examples/including-excluding-files-from-war.html?

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

Note in your post you have warSourceExcludes which excludes stuff in
warSourceDirectory (${basedir}/src/main/webapp)
And stuff in ${basedir}/src/main/webapp/WEB-INF may get treated
specially as "resources" and not even be available for
includes/excludes.

I'm no expert on this.
Try packagingExcludes instead.

If you think the documentation could be improved, please feel free to
make the changes and file a jira.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message