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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:12:55+00:00 2026-05-10T23:12:55+00:00

I have a multi-module maven project with an installer sub-project. The installer will be

  • 0

I have a multi-module maven project with an installer sub-project. The installer will be distributed as an executable JAR. It will setup the DB and extract the WAR file to the app server. I would like to use maven to assemble this jar like so:

/META-INF/MANIFEST.MF
/com/example/installer/Installer.class
/com/example/installer/…
/server.war

The manifest will have a main-class entry pointing to the installer class. How might I get maven to build the jar in this fashion?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T23:12:55+00:00Added an answer on May 10, 2026 at 11:12 pm

    You can build the jar using the Maven Assembly Plugin.

    First, you’ll need to add some information to your pom.xml plugins section to make the resulting jar executable:

    <plugin>   <artifactId>maven-assembly-plugin</artifactId>   <configuration>     <archive>       <manifest>         <mainClass>com.example.installer.Installer</mainClass>       </manifest>     </archive>   </configuration> </plugin> 

    I recommend using a separate assembly descriptor to build the actual installer jar. Here’s an example:

    <assembly>   <id>installer</id>    <formats>     <format>jar</format>   </formats>    <baseDirectory></baseDirectory>    <dependencySets>     <dependencySet>       <outputDirectory>/</outputDirectory>       <includes>         <!-- this references your installer sub-project -->         <include>com.example:installer</include>       </includes>       <!-- must be unpacked inside the installer jar so it can be executed -->       <unpack>true</unpack>       <scope>runtime</scope>     </dependencySet>     <dependencySet>       <outputDirectory>/</outputDirectory>       <includes>         <!-- this references your server.war and any other dependencies -->         <include>com.example:server</include>       </includes>       <unpack>false</unpack>       <scope>runtime</scope>     </dependencySet>   </dependencySets> </assembly> 

    If you’ve saved the assembly descriptor as ‘installer.xml’ you can build your jar by running the assembly like this:

    mvn clean package assembly:single -Ddescriptor=installer.xml

    Hope this helps. Here are some additional links that you might find useful:

    • Maven Assembly Plugin – Configuration and Usage
    • Creating Executable JARs using the Maven Assembly Plugin
    • Creating executable jars with Maven
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-module maven project made up of three sub-modules: web , service
I have a multi-module Maven project that makes use of WAR overlays (stack of
We have a multi-module Maven project who's primary artifact is a WAR. However our
I have a multi-module Maven project with a parent project P and three sub-modules
I have a multi module Maven project and I want the sub projects to
I have a multi module project consisting of several jar modules and a war
We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin
I have created a multi module maven project. Now I have shared the project
I have a multi module maven project and I would like to use versions
I use eclipse and the maven plugin. I have a big multi-module project (~6

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.