#chiroito ’s blog

Java を中心とした趣味の技術について

WSLでの設定メモ

Mavenローカルリポジトリを Windows と共有

/home/<WSLユーザ名>/.m2/settings.xmlを作成

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>/mnt/c/User/<Windowsユーザ名>/.m2/repository</localRepository>
</settings>

maven -Dmaven.repo.local=/mnt/c/User/<Windowsユーザ名>/.m2/repository でも可能ですが、毎回指定するのが面倒臭いので・・・