我使用 Dropbox 在三台不同的机器之间共享一个 Eclipse 项目。现在的问题是 .classpath 文件中的路径在所有机器上都不相同。我试图替换/Users/username
为,~
但这不起作用。但是,Dropbox 在不同的机器上同步该文件,这会导致问题。
有没有办法在每个项目的基础上配置该 .classpath 文件的名称和/或路径?
PS:这与版本控制无关。我知道并在这个项目中使用它,但我需要一个解决方案才能在没有版本控制的情况下工作。
目录结构如下
- .metadata(从同步中排除)
- src(版本控制)
- .classpath
- 我的其他文件
.classpath 文件由 sbt eclipse 命令生成。目前,它看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/scala-2.10/classes" path="src/main/scala"/>
<classpathentry kind="src" output="target/scala-2.10/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/scala-2.10/test-classes" path="src/test/scala"/>
<classpathentry kind="src" output="target/scala-2.10/test-classes" path="src/test/java"/>
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/com.typesafe.akka/akka-actor_2.10/bundles/akka-actor_2.10-2.1.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/com.typesafe.akka/akka-actor_2.10/srcs/akka-actor_2.10-2.1.0-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/com.typesafe/config/bundles/config-1.0.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/com.typesafe/config/srcs/config-1.0.0-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/com.typesafe.akka/akka-remote_2.10/bundles/akka-remote_2.10-2.1.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/com.typesafe.akka/akka-remote_2.10/srcs/akka-remote_2.10-2.1.0-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/io.netty/netty/bundles/netty-3.5.8.Final.jar" sourcepath="/Users/USERNAME/.ivy2/cache/io.netty/netty/srcs/netty-3.5.8.Final-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/com.google.protobuf/protobuf-java/jars/protobuf-java-2.4.1.jar" sourcepath="/Users/USERNAME/.ivy2/cache/com.google.protobuf/protobuf-java/srcs/protobuf-java-2.4.1-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.uncommons.maths/uncommons-maths/jars/uncommons-maths-1.2.2a.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.uncommons.maths/uncommons-maths/srcs/uncommons-maths-1.2.2a-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/com.esotericsoftware.kryo/kryo/jars/kryo-2.20.jar" sourcepath="/Users/USERNAME/.ivy2/cache/com.esotericsoftware.kryo/kryo/srcs/kryo-2.20-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/com.esotericsoftware.reflectasm/reflectasm/jars/reflectasm-1.07-shaded.jar" sourcepath="/Users/USERNAME/.ivy2/cache/com.esotericsoftware.reflectasm/reflectasm/srcs/reflectasm-1.07-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.ow2.asm/asm/jars/asm-4.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.ow2.asm/asm/srcs/asm-4.0-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/com.esotericsoftware.minlog/minlog/jars/minlog-1.2.jar" sourcepath="/Users/USERNAME/.ivy2/cache/com.esotericsoftware.minlog/minlog/srcs/minlog-1.2-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.objenesis/objenesis/jars/objenesis-1.2.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.objenesis/objenesis/srcs/objenesis-1.2-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/ch.ethz.ganymed/ganymed-ssh2/jars/ganymed-ssh2-build210.jar" sourcepath="/Users/USERNAME/.ivy2/cache/ch.ethz.ganymed/ganymed-ssh2/srcs/ganymed-ssh2-build210-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.7.jar" sourcepath="/Users/USERNAME/.ivy2/cache/commons-codec/commons-codec/srcs/commons-codec-1.7-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/junit/junit/jars/junit-4.8.2.jar" sourcepath="/Users/USERNAME/.ivy2/cache/junit/junit/srcs/junit-4.8.2-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.specs2/specs2_2.10/jars/specs2_2.10-1.13.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.specs2/specs2_2.10/srcs/specs2_2.10-1.13-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.specs2/scalaz-core_2.10/jars/scalaz-core_2.10-7.0.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.specs2/scalaz-core_2.10/srcs/scalaz-core_2.10-7.0.0-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.specs2/scalaz-concurrent_2.10/jars/scalaz-concurrent_2.10-7.0.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.specs2/scalaz-concurrent_2.10/srcs/scalaz-concurrent_2.10-7.0.0-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.specs2/scalaz-effect_2.10/jars/scalaz-effect_2.10-7.0.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.specs2/scalaz-effect_2.10/srcs/scalaz-effect_2.10-7.0.0-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.specs2/classycle/jars/classycle-1.4.1.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.specs2/classycle/srcs/classycle-1.4.1-sources.jar"/>
<classpathentry kind="lib" path="/Users/USERNAME/.ivy2/cache/org.mockito/mockito-all/jars/mockito-all-1.9.0.jar" sourcepath="/Users/USERNAME/.ivy2/cache/org.mockito/mockito-all/srcs/mockito-all-1.9.0-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/Users/USERNAME/Downloads/Java-WebSocket-master/dist/java_websocket.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>