Eclipse在大型Maven项目中依赖于"验证启动属性"

6 eclipse maven

我正在使用Eclipse开发一个大型Maven项目(几十个依赖项).当我尝试运行单元测试时,我看到暂停大约一分钟,而状态显示"验证启动属性".观察Eclipse在Process Monitor中的活动,我看到Maven存储库中对各种锁和jar的大量文件访问.看起来Eclipse会覆盖我的项目所依赖的每个JAR.一旦完成该文件访问,就开始实际测试.

我知道在" 启动运行配置时,为什么Eclipse挂起了57%的状态"验证启动属性... ",并且我遵循了建议的修复程序.我认为Eclipse通过遍历每一个JAR来做它应该做的事情.我的问题是,如何在Eclipse或Maven中禁用该行为?

我在Windows 7上使用Eclipse Luna,m2e版本1.5.0.20140606

编辑:

下面是我在Process Monitor中看到的示例:

简而言之,我们花费大约10秒钟进行合理的活动,例如检查Java和JAR文件的状态,然后我们花费大约40秒锁定Maven repo并读取POM文件.

为什么eclipse会这样做?我需要改变什么来阻止它?

11:31:48.1468054 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\org\drools\drools-core\6.0.1.Final\drools-core-6.0.1.Final.jar  SUCCESS Desired Access: Read Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:31:48.1469017 AM eclipse.exe 3736    QueryBasicInformationFile   C:\LAS\Maven\Repository\org\drools\drools-core\6.0.1.Final\drools-core-6.0.1.Final.jar  SUCCESS CreationTime: 7/21/2014 11:13:15 AM, LastAccessTime: 7/21/2014 11:13:15 AM, LastWriteTime: 7/21/2014  11:13:22 AM, ChangeTime: 7/21/2014 11:13:23 AM, FileAttributes: A
11:31:48.1469769 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\org\drools\drools-core\6.0.1.Final\drools-core-6.0.1.Final.jar  SUCCESS 

11:31:50.0040011 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar    SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:31:50.0040832 AM eclipse.exe 3736    QueryNetworkOpenInformationFile C:\LAS\Maven\Repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar    SUCCESS CreationTime: 7/21/2014 11:13:15 AM, LastAccessTime: 7/21/2014 11:13:15 AM, LastWriteTime: 7/21/2014 11:13:21 AM, ChangeTime: 7/21/2014 11:13:23 AM, AllocationSize: 28672, EndOfFile: 24956, FileAttributes: A
11:31:50.0041397 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar    SUCCESS 
Run Code Online (Sandbox Code Playgroud)

(价值4秒)

11:31:50.0700821 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\.locks\com.lmax~disruptor~3.3.0.aetherlock  SUCCESS Desired Access: Write Attributes, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:31:50.0701770 AM eclipse.exe 3736    SetBasicInformationFile C:\LAS\Maven\Repository\.locks\com.lmax~disruptor~3.3.0.aetherlock  SUCCESS CreationTime: 0, LastAccessTime: 0, LastWriteTime: 0, ChangeTime: 0, FileAttributes: N
11:31:50.0703100 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\.locks\com.lmax~disruptor~3.3.0.aetherlock  SUCCESS 

11:31:59.7990517 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\.locks\xpp3~xpp3_min~1.1.4c.aetherlock  SUCCESS Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:31:59.7991381 AM eclipse.exe 3736    QueryAttributeTagFile   C:\LAS\Maven\Repository\.locks\xpp3~xpp3_min~1.1.4c.aetherlock  SUCCESS Attributes: N, ReparseTag: 0x0
11:31:59.7991864 AM eclipse.exe 3736    SetDispositionInformationFile   C:\LAS\Maven\Repository\.locks\xpp3~xpp3_min~1.1.4c.aetherlock  SUCCESS Delete: True
11:31:59.7992609 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\.locks\xpp3~xpp3_min~1.1.4c.aetherlock  SUCCESS 
Run Code Online (Sandbox Code Playgroud)

(9秒的价值)

11:31:59.8364794 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\com\lmax\disruptor\3.3.0\disruptor-3.3.0-sources.jar    SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:31:59.8367613 AM eclipse.exe 3736    QueryNetworkOpenInformationFile C:\LAS\Maven\Repository\com\lmax\disruptor\3.3.0\disruptor-3.3.0-sources.jar    SUCCESS CreationTime: 11/18/2014 2:17:33 PM, LastAccessTime: 11/18/2014 2:17:33 PM, LastWriteTime: 11/18/2014 2:17:33 PM, ChangeTime: 11/18/2014 2:17:33 PM, AllocationSize: 81920, EndOfFile: 80291, FileAttributes: A
11:31:59.8367994 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\com\lmax\disruptor\3.3.0\disruptor-3.3.0-sources.jar    SUCCESS 

11:32:02.0222874 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\org\antlr\antlr-runtime\3.5\antlr-runtime-3.5.jar   SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:32:02.0223541 AM eclipse.exe 3736    QueryNetworkOpenInformationFile C:\LAS\Maven\Repository\org\antlr\antlr-runtime\3.5\antlr-runtime-3.5.jar   SUCCESS CreationTime: 7/21/2014 11:13:15 AM, LastAccessTime: 7/21/2014 11:13:15 AM, LastWriteTime: 7/21/2014 11:13:21 AM, ChangeTime: 7/21/2014 11:13:22 AM, AllocationSize: 167936, EndOfFile: 167735, FileAttributes: A
11:32:02.0223896 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\org\antlr\antlr-runtime\3.5\antlr-runtime-3.5.jar   SUCCESS 
Run Code Online (Sandbox Code Playgroud)

(价值3秒)

11:32:33.2963547 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\.locks\commons-logging~commons-logging~1.1.aetherlock   SUCCESS Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:32:33.2964727 AM eclipse.exe 3736    QueryAttributeTagFile   C:\LAS\Maven\Repository\.locks\commons-logging~commons-logging~1.1.aetherlock   SUCCESS Attributes: N, ReparseTag: 0x0
11:32:33.2965390 AM eclipse.exe 3736    SetDispositionInformationFile   C:\LAS\Maven\Repository\.locks\commons-logging~commons-logging~1.1.aetherlock   SUCCESS Delete: True
11:32:33.2966382 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\.locks\commons-logging~commons-logging~1.1.aetherlock   SUCCESS 
11:32:33.2970685 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS Desired Access: Synchronize, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
11:32:33.2971806 AM eclipse.exe 3736    QueryNameInformationFile    C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS Name: \LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom
11:32:33.2972430 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS 
11:32:33.2980275 AM eclipse.exe 3736    CreateFile  C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened
11:32:33.2981528 AM eclipse.exe 3736    ReadFile    C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS Offset: 0, Length: 4,096, Priority: Normal
11:32:33.2983145 AM eclipse.exe 3736    QueryStandardInformationFile    C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS AllocationSize: 8,192, EndOfFile: 6,182, NumberOfLinks: 1, DeletePending: False, Directory: False
11:32:33.2983774 AM eclipse.exe 3736    ReadFile    C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS Offset: 4,096, Length: 2,086
11:32:33.2984420 AM eclipse.exe 3736    QueryStandardInformationFile    C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS AllocationSize: 8,192, EndOfFile: 6,182, NumberOfLinks: 1, DeletePending: False, Directory: False
11:32:33.2985057 AM eclipse.exe 3736    QueryStandardInformationFile    C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS AllocationSize: 8,192, EndOfFile: 6,182, NumberOfLinks: 1, DeletePending: False, Directory: False
11:32:33.2987730 AM eclipse.exe 3736    CloseFile   C:\LAS\Maven\Repository\commons-logging\commons-logging\1.1\commons-logging-1.1.pom SUCCESS 
Run Code Online (Sandbox Code Playgroud)

(30秒!)

小智 2

到目前为止,唯一有帮助的是关闭我工作区中的许多项目。当我的工作空间有 30 个 Maven 依赖项时,单元测试需要 30 多秒才能启动。当我关闭这些项目并强制 Eclipse 转到本地存储库时,单元测试的启动需要 5 秒。

我发现开始时间和“外部”依赖关系之间没有相关性。只有“内部”(在工作区和打开的)依赖关系很重要。