<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry path="bin" kind="output"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry sourcepath="/Users/test/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/1.5.10.RELEASE/30b57e08642747fe1d8b95d0df714ce18a473cd1/spring-boot-starter-web-1.5.10.RELEASE-sources.jar" kind="lib" path="/Users/test/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/1.5.10.RELEASE/8bc445f3ee81e5322e46b28cbb33bca1800b69d9/spring-boot-starter-web-1.5.10.RELEASE.jar"/>
<classpathentry sourcepath="/Users/test/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-security/1.5.10.RELEASE/d26535c819c15f8d6171f15e3cedbb9d62951a3/spring-boot-starter-security-1.5.10.RELEASE-sources.jar" kind="lib" path="/Users/test/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-security/1.5.10.RELEASE/92fd7261c5cd66b95854bb7d90c131b19e394412/spring-boot-starter-security-1.5.10.RELEASE.jar"/>
<classpathentry sourcepath="/Users/test/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-devtools/1.5.10.RELEASE/3d3f141ce866bcc2d3afa43990802c1c238fef2c/spring-boot-devtools-1.5.10.RELEASE-sources.jar" kind="lib" path="/Users/test/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-devtools/1.5.10.RELEASE/64a5e292f913e4b782954765778e6f6910c0208c/spring-boot-devtools-1.5.10.RELEASE.jar"/>
。。。。
。。。。
</classpath>
你会发现Eclipse会帮助生成这样这个.classpath文件。
如图方框中所示,加载的jar文件都是使用的绝对地址配置的,如果再将这个项目copy到其他机器上,这些jar路径就会失效。
在Eclipse安装了buildship插件,然后.classpath文件配置就变得简单了:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin"/>
</classpath>
额外的Jar包都会被放到Project and External Dependencies里面。