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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:19:08+00:00 2026-05-16T03:19:08+00:00

I have a simple project with 3 dependencies but for some reason when i

  • 0

I have a simple project with 3 dependencies but for some reason when i am running from the eclipse run as -> maven install. i don’t get the dependencies. not inside the snapshot jar and not outside…
any idea?
this is my pom:

<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com</groupId>
  <artifactId>trade</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>trade</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.6</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.12</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>
  • 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-16T03:19:08+00:00Added an answer on May 16, 2026 at 3:19 am

    (…) I don’t get the dependencies. not inside the snapshot jar and not outside… any idea?

    Yes: this is just not supposed to happen for a project with a jar packaging. The created jar “only” contains classes from your project, the dependencies are “only” used during compilation and tests execution.

    From the Introduction to the Dependency Mechanism:

    Dependency Scope

    Dependency scope is used to limit the
    transitivity of a depedency, and also
    to affect the classpath used for
    various build tasks.

    There are 6 scopes available:

    • compile
      This is the default scope, used if none is specified. Compile
      dependencies are available in all
      classpaths of a project. Furthermore,
      those dependencies are propagated to
      dependent projects.
    • provided
      This is much like compile, but indicates you expect the JDK or a
      container to provide the dependency at
      runtime. For example, when building a
      web application for the Java
      Enterprise Edition, you would set the
      dependency on the Servlet API and
      related Java EE APIs to scope provided
      because the web container provides
      those classes. This scope is only
      available on the compilation and test
      classpath, and is not transitive.
    • runtime
      This scope indicates that the dependency is not required for
      compilation, but is for execution. It
      is in the runtime and test classpaths,
      but not the compile classpath.
    • test
      This scope indicates that the dependency is not required for normal
      use of the application, and is only
      available for the test compilation and
      execution phases.
    • system
      This scope is similar to provided except that you have to
      provide the JAR which contains it
      explicitly. The artifact is always
      available and is not looked up in a
      repository.
    • import (only available in Maven 2.0.9 or later)
      This scope is only used on a dependency of type pom in the
      <dependencyManagement> section. It
      indicates that the specified POM
      should be replaced with the
      dependencies in that POM’s
      <dependencyManagement> section.
      Since they are replaced, dependencies
      with a scope of import do not actually
      participate in limiting the
      transitivity of a dependency.

    …

    If you want to build a standalone executable jar including the dependencies, consider using the Maven Assembly Plugin and the pre-defined jar-with-dependencies descriptor. Have a look at these previous answers:

    • Building a runnable jar with maven 2
    • Is it possible to create an “uber” jar containing the project classes and the project dependencies as jars with a custom manifest file?
    • Problem building executable jar with maven

    Other options include the maven shade plugin, the onejar-maven-plugin. For simple use cases, I suggest using the assembly plugin.

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

Sidebar

Related Questions

We have a simple project where we read data from a socket and we
Im sure this will be a simple one but have a project that started
I have installation solution that have installer project (not web installer but simple installer)
I have a really simple ASP.NET web application and a web setup project that
I have a rather large project which contains a number of third-party dependencies which
I have just moved from phase 1 to phase 2 of a project. In
Previous I issued a question on how to change Maven project vesion from command
I have a new project which simply put, is an attempt to formalize the
I have simple regex \.*\ for me its says select everything between and ,
Ok, i have simple scenario: have two pages: login and welcome pages. im using

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.