Search code examples
eclipsemavenjavadoc

Wrestling with Eclipse-modified .classpath in a Mixed Windows/Mac Team Environment


I'm using Eclipse on a small development environment where one developer has a Windows PC and the other has a MacBook. We share code using a subversion repository, and use Maven as an "External Tool" (not using the m2e plugin).

We each have an M2_REPO variable that has been working great for resolving paths to .jar files on our two systems. Recently, however, I ran a command to tell Maven to pull down sources and javadocs.

mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true

Since then, I see some very Windows-centric references in my .classpath that are a nuissance to my Mac-using friend.

<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar"
  sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4-sources.jar">
    <attributes>
      <attribute value="jar:file:/C:/Users/John/.m2/repository/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4-javadoc.jar!/" name="javadoc_location"/>
    </attributes>
</classpathentry>

Even after having removed the downloadSources and downloadJavadocs parameters, and verified that they're false in my plugin configuration for maven-eclipse-plugin, deleted my .classpath file, and reran mvn eclipse:eclipse I still see those unwanted references placed into my .classpath file.

Has anyone found a good working solution to this problem? Have I overlooked some setting that tells Maven to use the M2_REPO variable in its references to javadoc files?


Solution

  • On my team we don't commit Eclipse .settings or .classpath files into source control. When we initially check out projects we use m2e to build the classpath (did it with eclipse goal as you are once upon a time) and everything is set up correctly no matter what platform the developer is using. We have people using Win 7, Macs, and various Linux flavors and the build machine is Linux, no issues I know of anywhere.