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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:08:47+00:00 2026-05-25T19:08:47+00:00

I want to build an application distribution with Maven. I have a module in

  • 0

I want to build an application distribution with Maven. I have a module in my project which holds the main source code. I decided to build the application distribution from this module. I’m telling maven in the module’s POM to copy all the configuration files and dependant libs to the target/ directory. My problem is that Maven keeps all the build related temporary dirs (like. classes, generated-sources, maven-archiver) in the target directory. I wan’t to auto delete these at least during the install phase. How can i achive this? If i put the maven-clean-plugin to the end of the build it looks like Maven always deletes the whole target directory, no matter who i’m trying to exclude files what i’m trying to keep.

  • 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-25T19:08:48+00:00Added an answer on May 25, 2026 at 7:08 pm

    try this in your pom

    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2-beta-4</version>
        <executions>
            <execution>
                <id>user_distribution</id>
                <phase>package</phase>
                <goals>
                    <goal>attached</goal>
                </goals>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/dist.xml</descriptor>
                    </descriptors>
                </configuration>
            </execution>
        </executions>
    </plugin>
    

    and here is the xml

    <?xml version="1.0" encoding="UTF-8"?>
    <assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/xsd/assembly-1.1.1.xsd">
    
        <id>dist</id>
        <formats>
            <format>zip</format>
        </formats>
        <files>
            <file>
                <source>target/${pom.artifactId}-${pom.version}.jar</source>
                <outputDirectory>lib/</outputDirectory>
            </file>
        </files>
        <fileSets>
            <fileSet>
                <directory>directory to be included</directory>
                <outputDirectory>/</outputDirectory>
                <includes>
                    <include>file name to be included</include>
                </includes>
            </fileSet>
            <fileSet>
                <directory>another directory to be included</directory>
                <outputDirectory>/</outputDirectory>
            </fileSet>
        </fileSets>
    </assembly>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build application which needs to be able to capture video from
i have a problem with my project. I want to build application using air
I want to build a web application where users can register and have a
I want to build an notepad-style application on android that will have syntax highlighting.
I want to build a very simple GUI based application in linux, c++. Which
I want to build an application, in which text boxes can take urdu language.
I have a number of maven projects which build various components of a plugin
I want to build an application that gets updates from online websites like Twitter
I want to build application which servers as a stand-alone system service, always run
I want to build iPhone application for non-english language and I have read about

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.