maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Repnik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARCHETYPE-572) Archetype Repository not set early enough
Date Fri, 26 Jul 2019 14:03:00 GMT

    [ https://issues.apache.org/jira/browse/ARCHETYPE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16893847#comment-16893847
] 

Thomas Repnik commented on ARCHETYPE-572:
-----------------------------------------

This issue can be closed: 

The problem was that we had in the mirror "*". Therefore the architype repository was not
respected. Maybe a hint in the documentation about this would save some people a lot of time
(and nerves ;) )

My Solution:
{code:xml}
<mirrorOf>*,!archetype</mirrorOf>
{code}

> 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.0.0, 3.0.1, 3.1.0, 3.1.1
>            Reporter: Thomas Repnik
>            Priority: Major
>
> 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)

Mime
View raw message