私は私の問題を解決しました。 sbt eclipse
コマンドは、Eclipse用の2つのファイルを作成します。それらは.classpath
と.project
です。 .ivy2
パスは.classpath
ファイルで与えられます。最初に、私は迷惑メールディレクトリに新しいフォルダを作成し、そのような新しいフォルダに自分のホームフォルダを同期させました。これをあなたのVagrantfile
に追加してください。
config.vm.synced_folder "data", "/home/vagrant"
次に、プロジェクトフォルダにsbt eclipse
を実行します。私のdata
フォルダに新しい.classpath
ファイルが作成されました。私は.classpath
ファイルのパスを読み込んで置き換えることができるpythonスクリプトを書いた。プロジェクトフォルダ内でこのスクリプトを実行すると、すべてのサブディレクトリが取得され、.classpath
ファイルが検索されます。次に、間違ったパスを正しいパスに置き換えます。
import os
import glob
#variables
current_dir = "/home/vagrant/"
dest_dir = "C:/Users/Test/Desktop/vm/data/"
#list for directories
filesDepth1 = glob.glob('*/')
dirsDepth1 = list(filter(lambda f: os.path.isdir(f), filesDepth1))
print(dirsDepth1)
#list for files
for directory in dirsDepth1:
print(directory)
root = os.path.dirname(os.path.realpath(__file__)) + "/" + directory
for item in os.listdir(root):
if os.path.isfile(os.path.join(root, item)):
print(item)
if(item == ".classpath"):
FileName = root + "/" + item
with open(FileName) as f:
newText=f.read().replace(current_dir,dest_dir)
with open(FileName, "w") as f:
f.write(newText)