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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:05:41+00:00 2026-06-12T07:05:41+00:00

we have different java source code projects. 3 projects are completly identical(fatclient, same dependencies

  • 0

we have different java source code “projects”. 3 projects are completly identical(fatclient, same dependencies etc.) – there is only another main class that have to be invoked.

Today we have one base-project with a main class:

<project>
    <groupId>net.company.BaseTool</groupId>
    <artifactId>BaseTool</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>BaseTool</name>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>net.company.BaseTool</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

and other projects that depending on the base-project

<project>
    <groupId>net.company.AnotherTool</groupId>
    <artifactId>AnotherTool</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>AnotherTool</name>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>net.company.AnotherTool</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>net.company.BaseTool</groupId>
            <artifactId>BaseTool</artifactId>
            <version>1.1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
</project>

We are doing this, because we need simple double-click startable applications.

But I dont want to create an extra java project for each application.

My question is: Is it possible to create multiple assemblies from one project? And if yes, how it should be done.

Here comes the solution

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>my.company.toolbox</groupId>
    <artifactId>toolbox</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>toolbox</name>
    <url>http://wiki.company.my/toolbox</url>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <finalName>toolbox</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>ToolOne</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>ToolOne</finalName>
                            <archive>
                                <manifest>
                                    <mainClass>my.company.ToolOne</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                    <execution>
                        <id>ToolTwo</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>ToolTwo</finalName>
                            <archive>
                                <manifest>
                                    <mainClass>my.company.ToolTwo</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                    <execution>
                        <id>ToolThree</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>ToolThree</finalName>
                            <archive>
                                <manifest>
                                    <mainClass>my.company.ToolThree</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                    <execution>
                        <id>ToolFour</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>ToolFour</finalName>
                            <archive>
                                <manifest>
                                    <mainClass>my.company.ToolFour</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
  • 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-12T07:05:42+00:00Added an answer on June 12, 2026 at 7:05 am

    You can use different executions of the assembly plugin and then attach the resulting assembly to the build. Of course you have to configure different final names for the artifacts in the assembly plugin configuration.

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

Sidebar

Related Questions

I've a requirement where I have to extract metrics from different Java projects (configured
Is it possible to have same hashcode for different strings using java's hashcode function?or
With RAD Version: 7.5.3, Java 1.5. I have a couple of different projects. I
I have a question regarding the compatibility between different java versions. On my computer,
i have a JTree in Java with different parent nodes such as computers, gaming
I have a java program that performs 5 different tasks. When I run the
I have an Java applications which I would like to run with different values
I have a bunch of third-party Java classes that use different property names for
We have a Prepared Statement in Java and we hear that it is different
I code mostly in Java and use Maven for all of my projects. I

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.