Skip to content

[Question] How to change the local cache directory? (Or portability?) #97

Closed

Description

@xycabcd

I found it's ".m2/repository" by default, but can't find a way to change it.

Activity

  1. quintesse commented on Jan 20, 2026

    @quintesse
    Contributor

    jpm will actually use whatever is defined in $HOME/.m2/settings.xml but I'm guessing you want a command line option to change the directory on the fly?

  2. xycabcd commented on Jan 21, 2026

    @xycabcd
    Author

    Thank you for responding.
    After knowing that jpm also reads settings.xml, I think what I should say is to support portability. I opened this issue because on my computer, I organize programs into folders and I don't want them to touch/read anything else unexpectly. I think this applies to many people. For example people on restricted environments.
    I know it's probably MIMA doing it by default and changing this requires work. But I really think implementing portability will make both me and lots of other people's life better.

  3. quintesse commented on Jan 21, 2026

    @quintesse
    Contributor

    Ok, I understand what you're saying. But I'd like to understand better how you'd see this work. Because like you said this is how MIMA does it. And it does it because that's how Maven and Gradle work. In your case, how do you normally manage Maven and Gradle? Because in the end it would be the most efficient if all could share the same cache.

  4. xycabcd commented on Jan 22, 2026

    @xycabcd
    Author

    Since I'm not sure how many files does jpm read, I don't know how this should be done. But at least on my computer, I set GRADLE_USER_HOME. And for Maven, I set <localRepository>${maven.home}/../repo</localRepository> in maven-home/conf/settings.xml.
    At least in my opinion, if all files read are in a single directory, there should be a env var to change the directory's path. And if there's several separate files and dirs, there should be a env var for the path of each of them.

  5. changed the title [-][Question] How to change the local cache directory?[/-] [+][Question] How to change the local cache directory? (Or portability?)[/+] on Jan 22, 2026
  6. quintesse commented on Jan 23, 2026

    @quintesse
    Contributor

    Ok, both --cache (-c) flags have been added as well as a JPM_CACHE env var. A new version of jpm is already available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions