maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Repnik (JIRA)" <>
Subject [jira] [Created] (ARCHETYPE-572) Archetype Repository not set early enough
Date Fri, 26 Jul 2019 13:42:00 GMT
Thomas Repnik created ARCHETYPE-572:

             Summary: Archetype Repository not set early enough
                 Key: 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:
if ( definition.isDefined() && StringUtils.isNotEmpty( request.getArchetypeRepository()
) )
     //There is no way this lines ever get called
     getLogger().info( "Archetype defined by properties" );

//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.

This message was sent by Atlassian JIRA

View raw message