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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:30:20+00:00 2026-05-24T21:30:20+00:00

I have a requirement for a project in an open source operating system, to

  • 0

I have a requirement for a project in an open source operating system, to use Maven completely offline under nix environment. i.e. it should use the dependencies available in the system (probably at /usr/share/ + few other places?). Maven should not download any dependency from internet.

Is there a solution to achieve this? Creating the M2 repo in the system is not a viable solution. The issue is that the file system is read-only. We can only work on a temporary folder (/tmp for example) with write access. But maintaining a repo at a temporary location is a bad design, isn’t it?
Saying it another way, the new to be installed maven project should use the existing packages in the system, if available. If packages does not exist, it should get installed separately ( via the package manager), and should not be copied to the m2 repo.

Is there any known way to do this?

Thanks for the help!

PS: Please note that I’m not asking about -o option to take it offline!

  • 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-24T21:30:21+00:00Added an answer on May 24, 2026 at 9:30 pm

    The approach we used is the following.
    We’ve taken a decision to store m2 repo at /usr/share/maven-2/maven_home/m2_repo/. This isn’t a temporary folder, and needs admin rights to write. But that isn’t a problem since the installing packages also needs admin privileges.

    We’ve symlinked the jars in the repo to point to system-level jars. i.e. we maintained the maven repository structure, but the jars were symlinked them to the system-jars. This means there’s no unnecessary duplication and waste of space. We still keep the pom files in repo. The pom files were rewritten by a python script to match our needs.
    Further, we refered dependencies with the system scope. For example,

    <dependency>
      <groupId>groupId</groupId>
      <artifactId>artifactId</artifactId>
      <version>666</version>
      <scope>system</scope>
      <systemPath>/usr/share/maven-core/lib/maven-core.jar</systemPath>
    </dependency>
    

    With system scope, it doesn’t matter what the groupId:artifactId:version combination. It just picks the jar it find at <systemPath>

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

Sidebar

Related Questions

I am building a basic profiler for an open source project. One requirement is
I have been looking round for an open-source CMS framework that I can use
I work on an open-source Java project, and we have a lot of resource
I have recently started working on some open source project which I found relevant
We have a requirement in project to store all the revisions(Change History) for the
I have a project requirement where I need to authenticate against ActiveDirectory in a
In our project we have requirement that, after receiving sms message from third party
In our project we have a requirement that when a set of records are
I have a requirement on my current project (a Flex app which will be
I have a requirement on my new project to serve up some hidden assets

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.