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

  • SEARCH
  • Home
  • 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 8840277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:25:46+00:00 2026-06-14T10:25:46+00:00

I have a dependencies from other projects (.jsp’s, .tag files) that I need in

  • 0

I have a dependencies from other projects (.jsp’s, .tag files) that I need in my maven project. To solve this I have created a “resource” jar from these other projects and have specified them as a dependency in maven. I then unzip the jar (in ant, during the generate-sources lifecycle phase) and copy files to where they need to go. This is where the question is (suggestions on a better overall approach are also welcome). I was thinking I could just move these files into the target directory where I want them and they’d be packaged with the war, but that doesn’t work. The common approach seems to be to add an additional resource directory to the war plugin:

How create file and put it in a war with Maven?

Rename a generated file in Maven before building WAR

However, I really don’t want to keep these files around in my source code, since they belong to another project. Is there a way I can include temporary resources into the jar?

  • 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-06-14T10:25:48+00:00Added an answer on June 14, 2026 at 10:25 am

    I would say that this is a typical case when you should be looking at Maven War Overlay.

    Overlays are used to share common resources across multiple web applications. The dependencies of a WAR project are collected in WEB-INF/lib, except for WAR artifacts which are overlayed on the WAR project itself.

    It means that you can take pieces of another war and apply to your own war. The best thing would be if all the common resources would be in one parent war that would be used by other wars using the overlay technique.

    You add a dependency to the war you want to use as an overlay:

    <dependency>
        <groupId>com.acne</groupId>
        <artifactId>acne-web-style</artifactId>
        <type>war</type>
        <scope>compile</scope>
    </dependency>
    

    Then you apply it in the maven-war-plugin:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <overlays>
                <overlay>
                    <groupId>com.acne</groupId>
                    <artifactId>acne-web-style</artifactId>
                    <includes>
                        <include>**/resources/*.jpg</include>
                    </includes>
                </overlay>
                <overlay>
                    <!-- empty groupId/artifactId represents the current build -->
                </overlay>
            </overlays>
        </configuration>
    </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have java project that depends from other java projects. These projects are maven
I've a SBT multi-project where some projects have dependencies to each other. Like this:
My project has many dependencies that I've referenced from other projects. I am now
We have multiple Python projects that have dependencies on each other. Hierarchically, these are
I have several Maven projects in eclipse that depends on each other. Some of
I have one parent parent maven project that defines dependencies. Then I have my
I've been previously managing a 3-module project as 3 seperate maven projects. As this
I am currently recompiling gtk+ and dependencies from source (I have no other choices).
I have a project Processor and it depend on other 2 projects. When i
I have a solution with two C++ (CLR) projects. One project references the other,

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.