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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:43:27+00:00 2026-06-05T06:43:27+00:00

I have 2 Projects namely Project_1 and Project_2 . Both projects are Maven and

  • 0

I have 2 Projects namely Project_1 and Project_2.
Both projects are Maven and I am using Netbeans.

I want to include the jar of Project_1 in Project_2 which I am doing like this.

The problem is when I include the jar I do not get any compile time error, however I get a NoClassDefFoundError exception at runtime.

When I include the Project_1 in Project_2 by performing the steps mentioned here. (The Open Project example). I do not get any errors. Neither runtime nor compile time.

Can you please explain me what am I missing here?

Update

Project_2 is deployed on a Server which is not in my local machine however Project_1 is in my local machine.

Inclusion of Project_1 into Project_2 as a project was done for testing in my local machine.

  • 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-05T06:43:29+00:00Added an answer on June 5, 2026 at 6:43 am

    First of all, a good rule of thumb to adopt is never use the system scope and system path to pull in dependencies. In my experience there’s always a better way 🙂

    If Project_2 depends on Project_1, then first install it’s jar into the local repository:

       cd Project_1
       mvn clean install
    

    Watch the output you’ll discover the jar is placed somewhere under the following directory:

       $HOME/.m2/repository
    

    Once this is done the jar will be available as a normal dependency to the second build

      cd Project_2
      mvn clean compile
    

    The local repository ensures the projects are now decoupled from each other. Assuming you’re using snapshot revisions of Project_1, the Project_2 build will always retrieve the latest revision built and tested.

    Update

    You should use a Maven repository manager to share jars between machines/teams. Recommendations are contained in the following answer:

    Share jar of the module with another team

    How to configure Maven to use a repository like Nexus is described in it’s documentation.

    As described in the deploy plugin documentation you’ll need to add a distributionManagement section to your POM (detailing the repository URL) and then upload the project’s jar to your repository as follows:

       cd Project_1
       mvn clean deploy
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a runnable JAR that include referenced libraries, namely jackson ,
I am using apache ant in the following way: I have projects P1, P2,
I have 3 projects in my workspace - A, B, and C which is
I have a Hudson CI server which is building a making a maven build.
I am having 3 projects namely Pro1, Pro2 and Pro3. I have added the
For my last few projects I have been using some of the utility files
I have three projects(C# libraries) namely A,B,C. All the 3 have 3-4 xml files(in
I have an Excel project which contains 3 worksheets, namely Unhealthy Foods Healthy Foods
I have a simple master page (master.aspx), which has 3 link buttons namely HomeLBTn-which
I have projects that need to be build with a specific version of 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.