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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:44:05+00:00 2026-06-03T16:44:05+00:00

Apologies if this is covered elsewhere, I’m afraid I couldn’t find an answer to

  • 0

Apologies if this is covered elsewhere, I’m afraid I couldn’t find an answer to this particular trivial question.

I have a maven project which references and builds 4 sub projects (as bundles). I have set the dependencies between the sub-projects correctly and ultimately I get 4 different .jar files build built:

  • parentproj/sub1/target/sub1.jar
  • parentproj/sub2/target/sub2.jar
  • parentproj/sub3/target/sub3.jar
  • parentproj/sub4/target/sub4.jar

My question is, how do I set-up mu parent build so that when I build from the main .POM file, all 4 jars are placed in “/parentproj/target/…”?

An additional question is, how do I also build a xxxx-ALL.jar (that merges the contents of these 4 bundles)?

  • 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-03T16:44:08+00:00Added an answer on June 3, 2026 at 4:44 pm

    Just use the Maven Assembly plugin with the “dir” format to put them all in a folder, and the “jar” format to group them into a jar.

    Some more details:

    1. You start with your maven projects (let’s call them subprojects)
    2. Create a new maven project (pom packaging) that aggregates all the subprojects using < module > tags
    3. Put in the assembly plugin into your pom.xml file (see below)
    4. Create the correct assembly.xml file (see below)

    pom.xml file:

    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
            <execution>
                    <id>distro-assembly</id>
                <phase>package</phase>
                <goals>
                    <goal>single</goal>
                </goals>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                        <finalName>somefolder</finalName>
                        <attach>false</attach>
                        <descriptors>
                        <descriptor>assembly.xml</descriptor>
                        </descriptors>
                    <phase>package</phase>
                </configuration>
            </execution>
        </executions>
    </plugin>
    

    assembly.xml file:

    <assembly
    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
    <id>SomeName</id>
    <formats>
        <format>dir</format>
    </formats>
    <includeBaseDirectory>true</includeBaseDirectory>
    <baseDirectory></baseDirectory>
    
    <fileSets>
        <fileSet>
            <directory>appfiles</directory>
            <includes>
                <include>**</include>
            </includes>
            <outputDirectory>.</outputDirectory>
        </fileSet>
    </fileSets>
    
    <moduleSets>
        <moduleSet>
            <!-- useAllReactorProjects must be false if the assembly's run on the project with the module list -->
            <useAllReactorProjects>false</useAllReactorProjects>
            <includeSubModules>false</includeSubModules>
    
            <binaries>
                <includeDependencies>true</includeDependencies>
                <outputDirectory>bundle</outputDirectory>
                <unpack>false</unpack>
            </binaries>
        </moduleSet>
    </moduleSets>
    

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

Sidebar

Related Questions

Apologies if this has been answered before (I couldn't find the answer when I
Apologies if this question has been asked before, I couldn't find anything similar. I
Apologies if this is a too basic question but I couldn't find any satisfactory
Apologies if this question has been asked. I couldn't find it, but if it
Folks, Apologies if this has been covered in another thread, but I have searched
Apologies if this is a duplicate, but I've not managed to find this question
Apologies if this has been asked before. I searched and couldn't find it. In
Apologies if this is overly basic, but I couldn't find much info with my
Apologies if this is a dup, I searched but couldn't quite find the info
Apologies if this question has been asked already, but suppose we have this code

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.