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

  • Home
  • SEARCH
  • 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 9202519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:16:38+00:00 2026-06-17T23:16:38+00:00

I am using maven to build my project. I wanted to create assembly jar

  • 0

I am using maven to build my project. I wanted to create assembly jar including some of the dependencies, so I wrote my custom assembly descriptor.

POM.XML

<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>com.guavus</groupId>
  <artifactId>Exporter</artifactId>
  <version>atlas2.1</version>
  <packaging>jar</packaging>

  <name>Exporter</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <aspectj.version>1.6.10</aspectj.version>
    <org.springframework.version>3.0.5.RELEASE</org.springframework.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.guavus.exporter.Exporter</mainClass>
            </manifest>
          </archive>
          <descriptors>
            <descriptor>/Users/archit.thakur/Documents/Code_dev_cdn_mapreduce/exporter/src/main/configurator.xml</descriptor>
          </descriptors>
          <!--
          <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>     
              -->
          <finalName>Exporter-${project.version}</finalName>
          <appendAssemblyId>false</appendAssemblyId>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>


  <dependencies>
    <!-- local snapshots  -->
    <dependency>
      <groupId>com.guavus</groupId>
      <artifactId>CubeCreator</artifactId>
      <version>atlas2.1</version>
    </dependency>
    <dependency>
      <groupId>com.guavus</groupId>
      <artifactId>ConcurrentFlows</artifactId>
      <version>atlas2.1</version>
    </dependency>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
      <version>1.6.11</version>
    </dependency>
    <dependency>
      <groupId>ps</groupId>
      <artifactId>thriftGenerated</artifactId>
      <version>atlas2.1</version>
    </dependency>
    <!-- local snapshots  --><!-- local 3rd Party -->
    <dependency>
      <groupId>apache</groupId>
      <artifactId>libthrift</artifactId>
      <version>0.5.0</version>
    </dependency>
    <!-- local 3rd Party --><!-- remote 3rd Party -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-core</artifactId>
      <version>0.20.203.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>1.7.1</version>
    </dependency>

    <!-- remote 3rd Party --><!-- test libs --><!-- test libs -->
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjrt</artifactId>
      <version>1.6.11</version>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.16</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.2</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-access</artifactId>
      <version>1.0.1</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.0.1</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>1.0.1</version>
    </dependency>
  </dependencies>

</project>

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>dep</id>
  <formats>
    <format>jar</format>
  </formats>

  <dependencySets>

    <dependencySet>
      <scope>runtime</scope>
      <unpack>true</unpack>
      <useProjectArtifact>true</useProjectArtifact>
      <includes>
        <include>log4j:log4j</include>
        <include>org.slf4j:slf4j-api</include>
        <include>ch.qos.logback:logback-access</include>
        <include>ch.qos.logback:logback-classic</include>
        <include>ch.qos.logback:logback-core</include>
        <include>com.guavus:Exporter</include>
      </includes>
    </dependencySet>

  </dependencySets>

</assembly>

The problem is, It is creating jar having classes at directory structure like “Exporter-atlas2.1//”. For example, “Exporter-atlas2.1/ch/qos/logback/classic/util/EnvUtil.class”. Thats why, it throws, ClassNotFoundException at the runtime. I was expecting classes to be present at “/”,For eg. “ch/qos/logback/classic/util/EnvUtil.class”.

  • 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-17T23:16:39+00:00Added an answer on June 17, 2026 at 11:16 pm
    <includeBaseDirectory>false</includeBaseDirectory> 
    

    in the assemly configurator resolved the issue.

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

Sidebar

Related Questions

Im using maven to build a multi module project. But some projects are in
I'm using maven to build a .ear project that resolves dependencies from a maven
I'm thinking of using IntelliJ+Maven+GWT. I'd like to create/build project using maven and do
I am new to Maven and using it to build a project on my
We have our project build using maven. We try to run our unit test
I'm using maven to build the project and compile failed because I put class
I've added some extra 'dev' GWT modules into my project. Since I'm using Maven
I'm currently using Maven to build my Rhino JavaScript project, download dependent libraries, and
Using Maven build system under eclipse. I have just switched by project from using
I am using Maven framework to build my project and EJB 3.0 is the

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.