Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scyjava does not agree with jgo on default m2 repo path #69

Open
ctrueden opened this issue Nov 29, 2024 · 1 comment
Open

scyjava does not agree with jgo on default m2 repo path #69

ctrueden opened this issue Nov 29, 2024 · 1 comment

Comments

@ctrueden
Copy link
Member

As reported downstream in PyImageJ, scyjava sets the m2_repo to ~/.m2/repository by default. Although you can override it using scyjava.config.set_m2_repo, the upstream jgo library has a function jgo.m2_path which does as follows:

def m2_path():
    return os.getenv("M2_REPO", (pathlib.Path.home() / ".m2").absolute())

In other words: it looks also at the M2_REPO environment variable, before falling back to ~/.m2.

This behavior in jgo is actually wrong because M2_REPO is supposed to point to the actual local Maven repository cache directory e.g. ~/.m2/repository, not the parent ~/.m2. So a fix is needed in jgo; see also scijava/jgo#99 which covers essentially the same issue for M2_HOME. Probably the m2_path function should be deprecated in favor of two functions m2_home and m2_repo instead.

And then what scyjava should do is ask jgo—once jgo yields the correct answer—what its default should be, so that it matches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants