关于maven:m2e无法使用Artifactory解析原型

m2e can't resolve archetypes using Artifactory

我有这种类型的问题:

我已将Artifactory配置为内部代理存储库,一切正常,但现在我无法使用m2Eclipse向导创建新项目。

我用这种方式修改了settings.xml:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<proxies>
 <proxy>
   <id>optional</id>
   true</active>
   <protocol>http</protocol>
   <username></username>
   <password></password>
   <host>myproxymachine.mycompany.com</host>
   <port>8080</port>
   <nonProxyHosts>*.mycompany.com|127.0.0.1</nonProxyHosts>
 </proxy>
</proxies>

<servers>
 <server>
  <username>user</username>
  <password>pwd</password>
  <id>central</id>
</server>
<server>
  <username>user</username>
  <password>pwd</password>
  <id>snapshots</id>
</server>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<profile>
  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>libs-release</name>
      <url>http://srvmmaven.mycompany.com:8081/artifactory/libs-release</url>
    </repository>
    <repository>
      <snapshots />
      <id>snapshots</id>
      <name>libs-snapshot</name>
      <url>http://srvmmaven.mycompany.com:8081/artifactory/libs-snapshot</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>repo</name>
      <url>http://srvmmaven.mycompany.com:8081/artifactory/repo</url>
    </pluginRepository>
    <pluginRepository>
      <snapshots />
      <id>snapshots</id>
      <name>repo</name>
      <url>http://srvmmaven.mycompany.com:8081/artifactory/repo</url>
    </pluginRepository>
  </pluginRepositories>
  <id>artifactory</id>
</profile>

1
2
 artifactory</activeProfile>
</activeProfiles>

当我尝试创建一个新项目时,Eclipse在尝试加载Nexus目录时崩溃。

这是堆栈跟踪:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
!ENTRY org.eclipse.core.jobs 4 2 2013-03-27 10:16:19.803
!MESSAGE An internal error occurred during:"Retrieving archetypes:".
!STACK 0
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOfRange(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at org.apache.lucene.index.TermBuffer.toTerm(TermBuffer.java:122)
at org.apache.lucene.index.SegmentTermEnum.term(SegmentTermEnum.java:167)
at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:251)
at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:218)
at org.apache.lucene.index.SegmentTermDocs.seek(SegmentTermDocs.java:55)
at org.apache.lucene.index.MultiSegmentReader$MultiTermDocs.termDocs(MultiSegmentReader.java:608)
at org.apache.lucene.index.MultiSegmentReader$MultiTermDocs.next(MultiSegmentReader.java:559)
at org.apache.lucene.search.FieldCacheImpl$10.createValue(FieldCacheImpl.java:384)
at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:71)
at org.apache.lucene.search.FieldCacheImpl.getStringIndex(FieldCacheImpl.java:351)
at org.apache.lucene.search.FieldSortedHitQueue.comparatorString(FieldSortedHitQueue.java:415)
at org.apache.lucene.search.FieldSortedHitQueue$1.createValue(FieldSortedHitQueue.java:206)
at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:71)
at org.apache.lucene.search.FieldSortedHitQueue.getCachedComparator(FieldSortedHitQueue.java:167)
at org.apache.lucene.search.FieldSortedHitQueue.<init>(FieldSortedHitQueue.java:55)
at org.apache.lucene.search.TopFieldDocCollector.<init>(TopFieldDocCollector.java:43)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:121)
at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:113)
at org.apache.lucene.search.Hits.<init>(Hits.java:90)
at org.apache.lucene.search.Searcher.search(Searcher.java:61)
at org.apache.maven.index.DefaultSearchEngine.searchFlat(DefaultSearchEngine.java:191)
at org.apache.maven.index.DefaultSearchEngine.searchFlatPaged(DefaultSearchEngine.java:111)
at org.apache.maven.index.DefaultSearchEngine.searchFlatPaged(DefaultSearchEngine.java:89)
at org.apache.maven.index.DefaultNexusIndexer.searchFlat(DefaultNexusIndexer.java:404)
at org.apache.maven.index.archetype.NexusArchetypeDataSource.getArchetypeCatalog(NexusArchetypeDataSource.java:67)
at org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory$NexusIndexerCatalogFactory.getArchetypeCatalog(ArchetypeCatalogFactory.java:87)
at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage.getArchetypesForCatalog(MavenProjectWizardArchetypePage.java:519)
at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage$15.run(MavenProjectWizardArchetypePage.java:557)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

如果我从命令行使用Maven创建一个新项目,一切正常。

我正在使用Eclipse Indigo SR2和m2Eclipse插件版本1.3.1.20130219-1424

谢谢。


为了保持Q&amp; A顺序,我将复制@ charlee-chitsuk答案:

因为它显示为java.lang.OutOfMemoryError: GC overhead limit exceeded。 您可以尝试通过增加wiki.eclipse.org/Eclipse.ini中提到的XmxXms来设置Eclipse VM Arguments。