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 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
  • 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. 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

Ask A Question

Stats

  • Questions 165k
  • Answers 165k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Categories extend the original class, but they don't subclass it,… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer Haven't tested this, but it's something like: RewriteRule \.php$ -… May 12, 2026 at 12:54 pm
  • Editorial Team
    Editorial Team added an answer "0:0:0:0:0:0:0:1" is the IPv6 loopback address as defined in RFC… May 12, 2026 at 12:54 pm

Related Questions

I have a large application (~50 modules) using a structure similar to the following:
I have a multi-module (maven) spring build. All the modules publish some beans, and
I've got an IronPython script that executes a bunch of SQL statements against a
I'm developing a DirectShow application. I encounter a deadlock problem, the problem seems caused

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.