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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:45:30+00:00 2026-06-06T23:45:30+00:00

I couldn’t find a maven plugin that met my needs for minimizing javascript and

  • 0

I couldn’t find a maven plugin that met my needs for minimizing javascript and css, so I started to create my own. However, I seem to have hit a roadblock. The minimized versions of the files always get overwritten by either the war plugin or something else.

My file structure is

src
   main
       java
       webapp
           assets
                 css
                   style1.css
                   style2.css
                   style3.css
                 js
                   script1.js
                   script2.js
                   script3.js

My plugin takes those, minimizes them, and (is supposed to) replaces them in the build directory. How to I make sure that they are not overwritten?

  • 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-06T23:45:32+00:00Added an answer on June 6, 2026 at 11:45 pm

    Where does your plugin output the altered files to? The way I see it, it’s making the necessary changes (if it works) and then the maven war plugin copies the original resources over them.

    Perhaps you should attach your code and pom.xml, for a better answer.

    EDIT:

    After having had a look at your test project, the problem can been resolved with the following change to your pom.xml:

    diff --git a/pom.xml b/pom.xml
    index 0fb6044..ee693f7 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -72,9 +72,17 @@
                                    <version>2.2</version>
                                    <configuration>
                                            <webappDirectory>${basedir}/src/main/webapp</webappDirectory>
    +                                       <warSourceExcludes>assets</warSourceExcludes>
    +
                                            <failOnMissingWebXml>false</failOnMissingWebXml>
    +                                       <webResources>
    +                                               <resource>
    +                                                       <!-- this is relative to the pom.xml directory -->
    +                                                       <directory>${project.build.directory}/minified</directory>
    +                                               </resource>
    +                                       </webResources>
                                    </configuration>
                            </plugin>
                    </plugins>
            </build>
    -</project>
    \ No newline at end of file
    +</project>
    

    I am also under the impression that your modified css files are being altered into the src/main/webapp/assets directory which is incorrect. These files should only be changed after being copied over to the respective directory under the target directory.

    I have forked your repository and sent you a pull request.

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

Sidebar

Related Questions

Couldn't find a trace of the source code behind the Photos application that runs
Couldn't find anything really useful for my needs. So if I already know my
Hi couldn't find it for C#, I am trying something like that for (int
I couldn't find the answer to this in any other question. Suppose that I
Couldn't find an answer to this one. I have a WPF ListView control that
couldn't find similar posts, so posting my own question. I got variable array of
Couldn't find similar questions: I'm currently designing my app and after that I will
Couldn't find_if just be an overload of find ? That's how std::binary_search and friends
Couldn't find this in the faq. Does Flurry give analytics that distinguish users? So
I couldn't find anything similar to this anywhere. I have an array of pointers

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.