In general this function is mainly for internal use but maybe handy for debugging. The maven repository location can be defined by set_repository_location(...) or through the option options("rmaven.m2.repository"=...) option but defaults to a .m2/repository directory in the rmaven cache directory. This is not the default location for Maven when used from Java writing to the default Maven directory in user space is forbidden by CRAN policies. The result of this is that rmaven will have to unnecessarily download additional copies of Java libraries, onto the users computer and cannot re-use already cached copies. Also Maven wont be able to pick up jar files locally installed through standard Java tooling, unless the default CRAN approved location is overridden using set_repository_location("~/.m2/repository"). This is more of an issue for developers rather than users.

get_repository_location(settings_path = .settings_path())

Arguments

settings_path

the file path of the settings.xml to update (generally the supplied default is what you want to use)

Value

the location of the maven repository

Examples

# the default location:
get_repository_location()
#> /home/runner/.cache/rmaven/.m2/repository
# change the location to the Java default. This change will not persist between sessions.
opt = options("rmaven.m2.repository"=paste0(tempdir(),"/.m2/repository/"))
set_repository_location()
#> /tmp/RtmpiQqvcj/.m2/repository
get_repository_location()
#> /tmp/RtmpiQqvcj/.m2/repository
# revert to rmaven defaults
options(opt)
set_repository_location()
#> /home/runner/.cache/rmaven/.m2/repository