2016-07-14 4 views
0

私はWindows上でScala-IDEを使用しています。私のプロジェクトファイルは漠然としています。私はぼろぼろにsbtのプロジェクトを構築し、テストのためにサーバーを実行します。デプロイメントのために、sbt eclipseというEclipse設定ファイルを作成し、Scala-IDEにインポートしました。私の問題は、私が.ivy2ファイルにアクセスできないプロジェクトを実行しようとするときです。彼らは迷惑なホームフォルダにあるからです。どうすればこの問題を解決できますか?windowsから迷惑メール.ivy2ディレクトリにアクセスするには?

Description Resource Path Location Type Project 'test-api' is missing required library: '\home\vagrant\.ivy2\cache\com.google.guava\guava\bundles\guava-18.0.jar' test-api Build path Build Path Problem 

答えて

0

私は私の問題を解決しました。 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) 
関連する問題