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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:12:25+00:00 2026-05-27T08:12:25+00:00

I have the following problem. I have a multimodule project. I want to run

  • 0

I have the following problem. I have a multimodule project. I want to run maven-assembly plugin on the toplevel pom that is also a parent pom for its modules. I want the plugin to be executed only on the top level pom. Currently it tries to execute also on all the submodules. I do not want this as I just need to grab all the sources from all the modules and submodules in one place (toplevel target directory.)

Here is my descriptor:

<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>src</id>
<formats>
    <format>zip</format>
</formats>
<moduleSets>
    <moduleSet>
        <includeSubModules>true</includeSubModules>
        <sources>
            <useDefaultExcludes>true</useDefaultExcludes>
            <includeModuleDirectory>false</includeModuleDirectory>
            <fileSets>
                <fileSet>
                    <outputDirectory>/</outputDirectory>
                    <useDefaultExcludes>true</useDefaultExcludes>
                    <includes>
                        <include>src/main/**</include>
                        <include>src/test/**</include>
                        <include>target/classes/**</include>
                    </includes>
                </fileSet>
            </fileSets>
        </sources>
    </moduleSet>
</moduleSets>

The pom file looks like this:

<?xml version="1.0"?>
<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/maven-v4_0_0.xsd"
      >

<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>myid</groupId>
    <artifactId>myartid</artifactId>
    <version>1.1</version>
</parent>
<groupId>myid2</groupId>
<artifactId>TopLevelBuild</artifactId>
<packaging>pom</packaging>
<version>5.5-SNAPSHOT</version>
<name>Some Application</name>
<modules>
    <module>1</module>
    <module>2</module>
    <module>3</module>
    <module>4</module>
    <module>5</module>
    <module>6</module>
</modules>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit-dep</artifactId>
        <version>4.8.2</version>
        <scope>compile</scope>
    </dependency>
</dependencies>
</project>

Parent pom just contains some dependencies that I want to be inheritaed in all modules. Submodules have the current pom as parent.
Now if I run :

mvn assembly:single -Ddescriptor=somedes.xml

it runs ok on the toplevel pom and collect all the sources that I need. But it does not stop and start to execute this goal on all the subprojects, and of course there is no descriptor defined for the. How can I force the execution only on the toplevel pom?

...
[INFO] Processing sources for module project: LAST MODULE
[INFO] Building zip: ..../target/TopLevelBuild-5.5-SNAPSHOT-src.zip
[INFO] ------------------------------------------------------------------------
[INFO] Building deploy
[INFO]    task-segment: [assembly:single]
[INFO] ------------------------------------------------------------------------
[INFO] [assembly:single {execution: default-cli}]
[INFO] Processing sources for module project: module1-submodule1:jar:5.5-SNAPSHOT
[INFO] Processing sources for module project: module1-submodule1:jar:5.5-SNAPSHOT
[INFO] Building zip: .../module1/target/module1-5.5-SNAPSHOT-src.zip
[INFO] ------------------------------------------------------------------------
[INFO] Building module1
[INFO]    task-segment: [assembly:single]
[INFO] ------------------------------------------------------------------------
[INFO] [assembly:single {execution: default-cli}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to create assembly: Error creating assembly archive src: You must set at least one file.

I have tried to add:

-Dexecution.inherited=false

but it doesn’t help.Adding

-Dassembly.ignoreMissingDescriptor=true

also didn’t help. Any ideas?

  • 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-27T08:12:26+00:00Added an answer on May 27, 2026 at 8:12 am

    -Dassembly.runOnlyAtExecutionRoot=true

    This is the property that makes it work as described.

    • 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 2 project which uses assemblies (via maven-assembly-plugin at the
I am using GWT/JAVA for development. I have following problem: I want to remove
I have the following problem: I am creating a simple plugin jquery carousel, to
I have following problem: I want to check (C#) if a thread has finished
I have the following problem: I want to check if a website (in a
I have following problem. I want to create a file system based session storage
I have following problem: on my Jenkins 1.438 I have job with maven 3
I have following problem. I want to make some graphics in c# windows form.
i have following problem: i look for a variable to work with that comes
I have following problem: I want to convert some Binary Strings to an integer:

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.