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 7693491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:06:05+00:00 2026-05-31T21:06:05+00:00

I have a quite specific problem. I created a webapp and want to have

  • 0

I have a quite specific problem.
I created a webapp and want to have a jar build of the classes additionally to the web war.
No problem, I did that by:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <version>2.2</version>
      <configuration>
        <attachClasses>true</attachClasses>
      </configuration>
    </plugin>

By that also the resources from src/main/resources go into the jar. But as these resources are only for this web application, I don’t want them in the jar. I could move them to the webapp src folder, but I need filtering on the properties file, so it has to be a resources folder and therefore gets included by a war/jar build.

<resources>
  <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
  </resource>
</resources>

I tried to exclude them by configuring the maven-jar-plugin:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.4</version>
    <configuration>
      <excludes>
        <exclude>**properties</exclude>
      </excludes>
    </configuration>
  </plugin>

Works fine for a singular jar build by jar:jar, but unfortunatly not for the jar build done by the install phase.

Is there a way to apply these configurations to the maven-war-plugin?

I know I could extend the configuration by adding executions for building a jar, installing it locally and for deploying it to a remote repository, but that’s a little mess up.

Any help is welcome.

  • 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-31T21:06:06+00:00Added an answer on May 31, 2026 at 9:06 pm

    One way to do this would be by moving the Java sources to a separate project, which you then include in the WAR project as a dependency. This way, you have control over what goes into the JAR file and you could keep the other files in the WAR project, apply filtering etc.

    I found that separating functionality into fine-grained projects is often the best way to solve things instead of setting up multiple plugins with complex configuration to do the same. If it requires a complex setup, it’s probably the wrong way. Try to keep it simple 🙂

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

Sidebar

Related Questions

I have a quite specific client-server design case and I want to ask for
I have a specific problem regarding my website that I built with HTML, CSS,
This is quite a specific question, and I have had no luck on the
I have quite a few RewriteRules in my .htaccess that looks like this RewriteRule
I have quite a few cells that link to other worksheets/books, etc with standard
I have quite a problem concerning the use of relational database concepts in Delphi
I have quite big document in html format that generated from Microsoft Word. It
I have quite a large VB6 project, with many forms, classes, modules and user
I have a web application that relies on a MySQL database, for which I
I have an InstallShield (InstallScript) installation, created using IS2009, that's built automatically every night,

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.