Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5840359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:43:58+00:00 2026-05-22T11:43:58+00:00

The maven documentation for this has to be wrong. Here are the various permutations

  • 0

The maven documentation for this has to be wrong.

Here are the various permutations I have tried with all failing to exclude the file:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
      <warSourceExcludes>**/*server.properties</warSourceExcludes>
    </configuration>
  </plugin>

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
      <webResources>
        <resource>
          <!-- this is relative to the pom.xml directory -->
          <directory>src/main/resources/com/mycom/myapplication/</directory>
          <!-- there's no default value for this -->
          <excludes>
            <exclude>**/*server.properties</exclude>
          </excludes>
        </resource>
      </webResources>
    </configuration>
  </plugin>

A mail list entry suggests using this older version and a string list:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-war-plugin</artifactId>
    <version>2.0.1</version>
    <configuration>
      <webResources>
        <resource>
          <!-- this is relative to the pom.xml directory -->
          <directory>src/main/resources/com/pictage/provendirect/</directory>
          <!-- there's no default value for this -->
          <excludes>**/*server.properties</excludes>
        </resource>
      </webResources>
    </configuration>
  </plugin>

Which results in:

(found static expression: ‘/*server.properties’ which may act as a default value).
Cause: Cannot assign configuration entry ‘excludes’ to ‘interface java.util.List’ from ‘
/*server.properties’, which is of type class java.lang.String

Also tried:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.0.1</version>
    <configuration>
      <packagingExcludes>
        **/server.properties
      </packagingExcludes>
    </configuration>
  </plugin>

Any ideas? I am going crazy with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:43:59+00:00Added an answer on May 22, 2026 at 11:43 am

    A more careful reading of the maven docs suggests:

    <configuration>
      <webResources>
        <resource>
    

    should only be used when excluding resources outside /src/main/resources. To do it inside this folder, you need to use warSourceExcludes and possibly warSourceDirectory parameters if the property isn’t in the root of the directory.

    I cry a little inside when it takes me hours to to do something via configuration in maven when it could have been handled in two seconds with a scripting language but I guess it’s the ‘right’ way to implement it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a maven project that has both code and documentation (pdf files). When
I have a maven POM file for a web service. For one of the
In my maven project I want to assemble an ipkg file (This is like
When building a Maven plugin, where can I find documentation for the built-in expressions
I'm trying to create a maven plugin to generate a file with the URL
With maven-assembly-plugin it's possible to package a project into a single jar w all
I am using maven weblogic plugin 10.3.4. I have read the goal list of
If I have a maven profile activated by the presence of a property, how
I am running both maven inside the m2eclipse plugin, windows command line and my
I have a maven project with the following packages (for illustration only): Root: src/main/java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.