Thomas Repnik created ARCHETYPE-572:
---------------------------------------
Summary: Archetype Repository not set early enough
Key: ARCHETYPE-572
URL: https://issues.apache.org/jira/browse/ARCHETYPE-572
Project: Maven Archetype
Issue Type: Bug
Components: Plugin
Affects Versions: 3.1.1, 3.1.0, 3.0.1, 3.0.0
Reporter: Thomas Repnik
As of archetype 3.0 it is not possible anymore to specify the repository via
the command line (with {{_-DarchetypeRepository_}}). But there is an option
with specifiying a special "archetype" repository in settings.xml.
After migrating from 2.4 to 3.x we found out that the whole archetype process
takes minutes instead of seconds! The reason for that is, that 3.x always tries
to download the whole archetype-catalog.xml from our public repository.
It seems the following Code in archetype 3.x is buggy:
{code:java}
//FILE: DefaultArchetypeSelector.java:selectArchetype:67
if ( definition.isDefined() && StringUtils.isNotEmpty(
request.getArchetypeRepository() ) )
{
//There is no way this lines ever get called
getLogger().info( "Archetype defined by properties" );
return;
}
//This method call is very expensive. It can take minutes.
Map<String, List<Archetype>> archetypes = getArchetypesByCatalog(
request.getProjectBuildingRequest(), catalogs );
...
{code}
_request.getArchetypeRepository()_ is always NULL, because in archetype 3.x the
property was removed and the archetype repository (in settings.xml) will be set
much later.
Therefore the expensive lookup _getArchetypesByCatalog_ can not be prevented.
Due to this archetype 3.x is unusable now because every usage will take minutes
in our case.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)