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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:50:48+00:00 2026-05-17T23:50:48+00:00

I am using Maven Assembly plugin to pack a jar file. But when I

  • 0

I am using Maven Assembly plugin to pack a jar file.

But when I run mvn package, maven always trigger the [jar:jar {execution: default-jar}] to create a default jar file.

So I will have 2 jar files (one created by Assembly plugin and one created by Maven jar which i don’t want to be created).

How can I turn off the default-jar execution?

In my pom.xml, I am using: <packaging>jar</packaging>.

I don’t want to change it to <packaging>pom</packaging>.

  • 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-17T23:50:48+00:00Added an answer on May 17, 2026 at 11:50 pm

    (…) So i will have 2 jar files (one created by assembly plugin and one created by maven jar which i dont want to be created).

    Looks like you’re doing pretty complicated things. Maybe Maven is not the right tool in your case.

    How can I turn off the execution: default-jar.

    You can set the <phase> of the corresponding execution to something unknown, like none:

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <!-- this is used for inheritance merges -->
            <phase>package</phase>
            <!-- append to the packaging phase. -->
            <goals>
              <goal>single</goal>
              <!-- goals == mojos -->
            </goals>
          </execution>
        </executions>
      </plugin>
    

    This seems to work as long as you’re providing something else to be installed, like an assembly (I only tested install). But of course, this is a hack.

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

Sidebar

Related Questions

I'm using the minijar-maven-plugin to reduce the size of my jar-with-dependencies jar but I
I am creating an executable jar using the jar-with-dependencies component of the maven-assembly-plugin during
im using maven-jaxb2-plugin to generate from a 1.0xsd file: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <executions> <execution>
I am using Maven, with the one-jar pluggin, but when I run the one
I'm using the build-helper-maven-plugin to add it to my build, but I'd like to
I am using maven-assembly-plugin to construct an assembly. I want to include in the
I have a maven project where I am using the assembly plugin. I typically
I am using the Maven assembly plugin to prepare some configuration artifacts for different
I'm using the Maven 2 assembly plug-in to build a jar-with-dependencies and make an
i would like to release a snapshot project 'foo-1.0-SNAPSHOT' using the maven release plugin.

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.