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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:45:59+00:00 2026-06-06T12:45:59+00:00

I would like to create a Maven assembly that contains the transitive dependencies of

  • 0

I would like to create a Maven assembly that contains the transitive dependencies of an artifact without actually including the artifact itself. I have tried to exclude the artifact from the assembly, but then its dependencies aren’t included as a result.

ArtifactA has DependencyA, DependencyB

Assembly should contain DependencyA, DependencyB (without ArtifactA)

And I would preferrably like to do this without having to explicitly specifiy what dependencies to be included in the assembly because this will be done with multiple projects that have many dependencies.

Thank you!

  • 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-06T12:46:02+00:00Added an answer on June 6, 2026 at 12:46 pm

    I finally got it to work. This will produce an artifact that only contains the dependencies of the depende

    pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <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>moduletest</groupId>
        <artifactId>moduletest</artifactId>
        <version>1.0</version>
        <packaging>pom</packaging>
    
        <dependencies>
            <dependency>
                <groupId>dependency</groupId>
                <artifactId>dependency</artifactId>
                <version>1.0</version>
            </dependency>
        </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.3</version>
                    <configuration>
                        <descriptors>
                            <descriptor>assembly.xml</descriptor>
                        </descriptors>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    
    </project>
    

    assembly.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <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>module</id>
    
        <includeBaseDirectory>false</includeBaseDirectory>
    
        <formats>
            <format>zip</format>
        </formats>
    
        <dependencySets>
            <dependencySet>
                <excludes>
                    <exclude>dependency:dependency</exclude>
                </excludes>
                <useProjectArtifact>false</useProjectArtifact>
                <useTransitiveDependencies>true</useTransitiveDependencies>
            </dependencySet>
        </dependencySets>
    
    </assembly>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i would like create a array of structure which have a dynamic array :
I would like to create a c++ type that mimic the build-in type exactly.
I would like to create a class that runs something (a runnable) at regular
I have a Git repository that contains a bunch of top-level maven projects (each
I have a multi-module Maven project, and I would like to assemble together artifacts
I would like to create a general overview of several Maven projects in the
I have a multi-module maven project, and I'm trying to create an assembly for
I would like to create a ZIP distributable for my java application with Maven
I would like to create this shape using just css. I am pretty sure
I would like to create a json object to send as a post array,

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.