- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
好吧,这有点奇怪。
我们有一个 Gradle 多模块项目。我们使用 Gradle Eclipse 插件来生成 Eclipse 类路径。
Gradle 版本 2.0Eclipse 4.4(开普勒)JDK 1.8.05
问题是运行 Junit 测试或启动 Java 时,测试需要很长时间才能开始运行。超过 5 秒。
我在“进度”窗口中看到以下输出。
Launching: Starting virtual machine...
我之前没有遇到过这个问题,其他项目工作正常(不使用 gradle 生成的类路径)
生成的 .classpath 文件如下所示
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="output" path="build"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.2/decd76e2c461157804473468bbdc6b8eb6d6121b/logback-classic-1.1.2-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.2/b316e9737eea25e9ddd6d88eaeee76878045c6b2/logback-classic-1.1.2.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.slf4j/jcl-over-slf4j/1.7.7/b5a646b81b899e930f8600c5f45766dd82743d93/jcl-over-slf4j-1.7.7-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.slf4j/jcl-over-slf4j/1.7.7/56003dcd0a31deea6391b9e2ef2f2dc90b205a92/jcl-over-slf4j-1.7.7.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/com.google.guava/guava/17.0/7ca0efbeb87ca845b5d7a0ac9c21a4b7b95f7b28/guava-17.0-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/com.google.guava/guava/17.0/9c6ef172e8de35fd8d4d8783e4821e57cdef7445/guava-17.0.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.3.2/d2a489573c0ed2c4942b3660decad5d65087b406/commons-lang3-3.3.2-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.3.2/90a3822c38ec8c996e84c16a3477ef632cbc87a3/commons-lang3-3.3.2.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/javax.inject/javax.inject/1/a00123f261762a7c5e0ec916a2c7c8298d29c400/javax.inject-1-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-web/4.0.6.RELEASE/ea420724d884a43e3db4b08d2ca5ff75715ff9bb/spring-web-4.0.6.RELEASE-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-web/4.0.6.RELEASE/85ef4b91fcdd86d81e4a9b3e5f006dcb4128e6d/spring-web-4.0.6.RELEASE.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/com.google.code.gson/gson/2.2.4/a6dc5db8a12928e583bd3f23e72d3ab611ecd58f/gson-2.2.4-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/com.google.code.gson/gson/2.2.4/a60a5e993c98c864010053cb901b7eab25306568/gson-2.2.4.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.hamcrest/hamcrest-library/1.3/47a7ee46628ab7133129cd7cef1e92657bc275e/hamcrest-library-1.3-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.hamcrest/hamcrest-library/1.3/4785a3c21320980282f9f33d0d1264a69040538f/hamcrest-library-1.3.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.mockito/mockito-core/1.9.5/46f703fb4266140c544d48a189cb25947eb6333e/mockito-core-1.9.5-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.mockito/mockito-core/1.9.5/c3264abeea62c4d2f367e21484fbb40c7e256393/mockito-core-1.9.5.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-test/4.0.6.RELEASE/f0e39db787769d8926a6ae7baed1a1ebb9d6e50a/spring-test-4.0.6.RELEASE-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-test/4.0.6.RELEASE/b2f65445f300f1317fe694e6530cce39d7090ff6/spring-test-4.0.6.RELEASE.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.1.2/502e1c764542fe747896c1dc04f023acfe0e5cbc/logback-core-1.1.2-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.1.2/2d23694879c2c12f125dac5076bdfd5d771cc4cb/logback-core-1.1.2.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-aop/4.0.6.RELEASE/d21d57199535402a4afdb4e9406d6f5276a5b205/spring-aop-4.0.6.RELEASE-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-aop/4.0.6.RELEASE/e377760b7692569535573ba9f6e80b4b74869369/spring-aop-4.0.6.RELEASE.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-beans/4.0.6.RELEASE/5e37af2dc3a230912dbb06b45cc2c1d53c2c9abb/spring-beans-4.0.6.RELEASE-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-beans/4.0.6.RELEASE/587879b58acebeb5b0a63c01e822f9b44d9a4c77/spring-beans-4.0.6.RELEASE.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-context/4.0.6.RELEASE/778949f894ac1ee2d42a8f074a7477540f4d04a/spring-context-4.0.6.RELEASE-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-context/4.0.6.RELEASE/3bb3a52edabf9ffe73aa534fb085c816bac28b4d/spring-context-4.0.6.RELEASE.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-core/4.0.6.RELEASE/5b16ad4018f9012ce3917e2e1038d19d2da57285/spring-core-4.0.6.RELEASE-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-core/4.0.6.RELEASE/d880beac77d42c5798aa2b632ddd0e4ae47c79ad/spring-core-4.0.6.RELEASE.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b/hamcrest-core-1.3-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.objenesis/objenesis/1.0/b10c90e57b7bb985a7b6a704769428fe5c2a732c/objenesis-1.0-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.objenesis/objenesis/1.0/9b473564e792c2bdf1449da1f0b1b5bff9805704/objenesis-1.0.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/junit/junit/4.11/28e0ad201304e4a4abf999ca0570b7cffc352c3c/junit-4.11-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/junit/junit/4.11/4e031bb61df09069aeb2bffb4019e7a5034a4ee0/junit-4.11.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/aopalliance/aopalliance/1.0/4a4b6d692e17846a9f3da036438a7ac491d3c814/aopalliance-1.0-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/aopalliance/aopalliance/1.0/235ba8b489512805ac13a8f9ea77a1ca5ebe3e8/aopalliance-1.0.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-expression/4.0.6.RELEASE/b86718cc9e7b5f53be187e8e35b44ad2dfd0196b/spring-expression-4.0.6.RELEASE-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.springframework/spring-expression/4.0.6.RELEASE/5f0a135b8cf290aa244097dc6264ad0989d25c56/spring-expression-4.0.6.RELEASE.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/28bb0405fddaf04f15058fbfbe01fe2780d7d3b6/commons-logging-1.1.3-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f/commons-logging-1.1.3.jar" exported="true"/>
<classpathentry sourcepath="C:/gradlehome/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.7/acd62e31cc314266e73eebed0b6dd7ea974a0ed/slf4j-api-1.7.7-sources.jar" kind="lib" path="C:/gradlehome/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.7/2b8019b6249bb05d81d3a3094e468753e2b21311/slf4j-api-1.7.7.jar" exported="true"/>
<classpathentry kind="src" path="/my-api-core" exported="true"/>
</classpath>
如果我将库复制到项目内的文件夹并删除突出显示的行最后一个条目,那么测试将在几毫秒内开始!最后一个类路径条目的类型为“src”
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="output" path="build"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="lib/aopalliance-1.0.jar" />
<classpathentry kind="lib" path="lib/commons-lang3-3.3.2.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.3.jar"/>
<classpathentry kind="lib" path="lib/guava-17.0.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-library-1.3.jar"/>
<classpathentry kind="lib" path="lib/javax.inject-1.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.7.7.jar"/>
<classpathentry kind="lib" path="lib/logback-classic-1.1.2.jar"/>
<classpathentry kind="lib" path="lib/logback-core-1.1.2.jar"/>
<classpathentry kind="lib" path="lib/marketplace-api-core-1.0.jar"/>
<classpathentry kind="lib" path="lib/mockito-core-1.9.5.jar"/>
<classpathentry kind="lib" path="lib/objenesis-1.0.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.7.jar"/>
<classpathentry kind="lib" path="lib/spring-aop-4.0.6.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-beans-4.0.6.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-context-4.0.6.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-core-4.0.6.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-expression-4.0.6.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-gson-http-message-converter.jar"/>
<classpathentry kind="lib" path="lib/spring-test-4.0.6.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/spring-web-4.0.6.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/gson-2.2.4.jar" exported="true"/>
**<classpathentry exported="true" kind="src" path="/my-api-core"/>**
</classpath>
我无法找出导致启动缓慢的原因?
更新:如果我创建 Ubuntu VM 并使用与 Gradle 生成的 Eclipse 类路径相同的项目,则不会出现问题
最佳答案
正如您所见,Gradle 在生成 Eclipse 配置文件方面做得很糟糕。我推荐installing the Gradle IDE features from Spring Tool Suite并让它管理您的 Eclipse 构建路径。这样,您最终会得到一个 .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="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
我真的希望生成 Eclipse 项目文件的 Gradle 插件更智能,但从我读到的内容来看,该团队似乎对此主题不感兴趣。
顺便说一句,还建议将 .project
和 .classpath
以及其他 Eclipse 配置文件 checkin 源代码管理中,以便每个用户都获得完全相同的项目配置。
关于java - Eclipse 和 Gradle 类路径导致启动缓慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25425983/
我想在文件系统上手动创建文件夹/文件,以便在 eclipse 的工作区中创建新项目,并在启动 eclipse 并选择工作区时显示在项目资源管理器中。 执行此操作需要创建哪些文件,它们需要位于何处? 请
我正在关注these instructions ,但在运行 mvn eclipse:eclipse 等命令时遇到问题。 我应该如何以及在哪里运行该命令? 我的设置: Windows 7 32 位 面向
是否有任何命令可以在不实际启动 eclipse 的情况下创建 eclipse 工作区?我希望该命令成为脚本的一部分。创建工作区后,将对其进行配置(例如文本编码),然后用于将项目导入到 RTC。我知道下
我想为 Eclipse 插件创建一个自动安装程序(即不通过“更新管理器”)。我的场景很简单:用户关闭 Eclipse,将下载的 JAR 放入 dropins 文件夹,启动 Eclipse,其余的过程是
每当我们想要使用现有源位置创建 Eclipse 项目时,我们将选择现有源位置(根)作为项目位置。 Eclipse 将在该源的根目录中创建所有项目特定文件。 现在,出于某种原因,如果我们想用不同的设置重
可能被问过多次; 有没有办法从控制台(Linux 或 Windows)刷新 Eclipse 工作区文件夹。 我知道有 Ant 任务可以做到这一点。但很想知道是否有命令行技巧。 最佳答案 不,您能做的最
我说的是工具栏上的小图标。 网络上似乎没有任何这样的问题,它们都指的是 android 或自定义应用程序,而不是与 eclipse 捆绑在一起的图标。 我想知道是否有人尝试过这个,或者可以告诉我它不值
如何使用 Eclipse 比较两个文件? (目前我正在使用 WinMerge 。) 最佳答案 要在 Eclipse 中比较两个文件,请首先在 Project Explorer/Package Expl
我正在尝试将我在一个带有数据库的 Eclipse JEE6 项目中所做的所有工作转移到另一个 Eclipse 程序。我知道我将不得不重新配置很多并重建很多库文件,但是尽可能多地传输的最简单方法是什么?
在 Eclipse 中加载我的工作台并启用 TFS 插件时,它挂起。与此类似: http://social.msdn.microsoft.com/Forums/vstudio/en-US/85c1d3
Eclipse 可以通过插件包含许多不同的功能集。您是否在一个 Eclipse 中安装所有插件?或者您是否从 spring 安装 STS,从 adobe 安装 Flex eclipse,甚至从 ecl
我错误地单击了“在 Eclipse 首选项中将目标运行标记为忽略在 Eclipse 构建中(实验)”: 在哪里/如何撤消此操作? 最佳答案 m2e 使用文件 YOUR_WORKSPACE/.metad
我是 Maven 新手。我尝试执行 >mvn eclipse:eclipse -Dwtpversion=2.0。但我收到以下错误: D:\test\CounterWebApp>mvn eclips
当我运行多个 Eclipse 实例时,操作系统不断请求上述权限。 我已经授予了该权限,并且我尝试了多次禁用和启用该权限。 我正在使用, macOS Catalina(版本:10.15.3 (19D76
我有一个 Maven 项目,其中我在项目构建期间使用 wsimport 作为目标来使用 Web 服务。 org.codehaus.mojo
当尝试使用 eclipse 新软件功能安装 eclipse 时,出现此错误: Cannot complete the install because one or more required item
我已经下载了整个 Eclipse Helios/Indigo 版本的源代码。现在我想对它进行一些修改等等。所以我导入了整个源代码,但现在我在编译时遇到了 n 个错误。此外,我正在尝试 RunAs> 插
我已经安装了 eclipse Oxygen 并且正在尝试连接到 Eclipse 市场,以安装插件,它给出了以下异常 - org.eclipse.equinox.p2.core.ProvisionExc
我的 IDE 中安装了来自 Sonatype 的 m2Eclipse 插件。它允许我通过右键单击 pom.xml 文件并导航到“运行方式”菜单来运行各种 Maven 命令(打包、安装等)。 但是,我还
我在 Windows7 64 位上运行 Maven 3 时遇到问题。当我执行maven eclipse:eclipse(我使用maven-eclipse-plugin 2.8)时,maven不会创建任
我是一名优秀的程序员,十分优秀!