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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:13:28+00:00 2026-06-17T14:13:28+00:00

I am using maven for my development purposes. I have a requirement that I

  • 0

I am using maven for my development purposes. I have a requirement that I want to include some of the third party jar in my project jar and exclude others specified in pom.xml file. Below is my pom.xml file.

<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.ckdm</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>
                <version>2.4</version>
                <configuration>
                    <descriptorRefs>
                            <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            <executions>
                    <execution>
                            <id>make-assembly</id> 
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>com.ckdm</groupId>
        <artifactId>CubeCreator</artifactId>
        <version>atlas2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.guavus</groupId>
        <artifactId>ConcurrentFlows</artifactId>
        <version>atlas2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>ps</groupId>
        <artifactId>thriftGenerated</artifactId>
        <version>atlas2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>apache</groupId>
        <artifactId>libthrift</artifactId>
        <version>0.5.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-core</artifactId>
        <version>0.20.203.0</version>
    <scope>provided</scope> 
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>1.7.1</version>
  <scope>provided</scope>   
    </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.6.4</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>

I read somewhere that specifying scope as provided doesn’t include the jar’s in the project jar. Where am I getting wrong, it is not able to include any of the jars?

  • 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-17T14:13:30+00:00Added an answer on June 17, 2026 at 2:13 pm

    as per your above comments, I assume you have one jar which has your main class in it.

    Add MANIFEST.MF file in you project. Its contents should be like below:

    Manifest-Version: 1.0
    Class-path: YourMainJar.jar thirdparty1.jar thirdparty2.jar
    Main-Class: com.test.mymainclass
    

    YourMainJar.jar is the file in which you have your main class, third party jars needs to be on the same location where your YourMainJar.jar is placed.

    When you double click your YourMainJar.jar, it will automatically run and also pick your third party jars from the same location.

    Note: You need to include this MANIFEST.MF when you are packing your project as jar.

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

Sidebar

Related Questions

I have a Java project that is built using Maven , thus my build
Im using maven to checkout some projects. I don't want maven to checkout a
Im using maven to build a multi module project. But some projects are in
We're using maven 2.1.0. I have multiple modules that are completely separate, but still
I am looking at using Maven 3 for some web development. I know how
I am new to using Maven. I have Java files that have dependencies. Like
Say you have a project that uses maven and a subversion repository. It consists
I find it very frustrating doing web development with Maven & Jetty using Eclipse,
I am using maven-shade-plugin for a simple maven project, the plugin successfully includes all
I am using maven to build applications. I have deployed a WAR file containing

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.