Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
3.0.0, 3.0.1, 3.1.0, 3.1.1
-
None
-
None
Description
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:
//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 ); ...
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.