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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:04:05+00:00 2026-05-25T01:04:05+00:00

My project depends on some 3rd-party JARs which are not available in Maven Central.

  • 0

My project depends on some 3rd-party JARs which are not available in Maven Central.

Most information I see regarding this situation, including the official Maven Guide to installing 3rd party JARs, advises installing the artifact into the local repository using mvn install:install-file .... This works well when developing locally, but when the build needs to be performed on many different systems in an automated fashion, requiring this manual step is undesirable and impractical.

Another solution often presented is to install the dependency into an organization-wide repository, however there are circumstances in which that isn’t possible.

With neither of those options being acceptable, I can think of two options:

  1. Store the JAR in a lib directory within the project and declare the dependency with a system scope (as suggested in several answers). This would seem to work on any system since the dependency is bundled with the project, but I’ve seen the use of system discouraged as a bad practice (typically with no more explanation than that).
  2. Bind the maven-install-plugin to the initialize lifecycle phase to install the artifact to the local repository. However, as pointed out here, this would cause unnecessary overhead as it runs for each and every build. If there were a way to execute this lazily only when the artifact is not installed, that might be ideal.

I would like a standard Maven project that can be built using the regular Maven lifecycle, without any out-of-band “run scripts/init-dependencies first” steps required.

What is the best way forward?

  • 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-25T01:04:05+00:00Added an answer on May 25, 2026 at 1:04 am

    Here is a recent answer to that question: Maven: keeping dependent jars in project version control

    I do not recommend using install-file in the lifecycle. As you’ve mentioned, it will run every time – the above solution will skip through the project quite quickly. While the above creates a new module, it does reduce the verbosity needed for many JARs, allows you to use a repository format that can easily be copied into a repository manager, and keeps this out of your main build.

    I also do not recommend using system scope for the reasons mentioned some answers to the questions you linked to list.

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

Sidebar

Related Questions

I have a maven Java project (Project A) which depends on a second project
I have created a java application which depends upon some external jars. Now I
I have a project A which depends on artifact B. I made some hack
I have a project that depends upon some other binaries to be downloaded from
Suppose, I have an opensource project that depends on some library, that must be
I've a main project that depends on other Library projects that use external JARS
I have a project which depends on an artifact which is controlled by a
I'm trying to build a VS 2005 website project which depends on several managed
I have java project that depends from other java projects. These projects are maven
I have a project that needs to disable/enable some NSToolbarItem s depends on different

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.