Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-520

Following mirror configuration from settings.xml for downloading archetype metadata

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.1
    • Component/s: Plugin
    • Labels:
      None

      Description

      Since using the maven-archetype-plugin with version 3.0.0 the plugin tries to connect to both our internal nexus and to http://repo.maven.apache.org for downloading Maven artifacts used by Archetypes. Since we are using a proxy, the generation of the archetype is delayed until the download of the Maven artifacts times out.

      We'd expect the archetype to only contact our own artifact repository, without trying to connect to http://repo.maven.apache.org at all.

      I've attached a snippet with the debug output of the archetype:generate goal and the configuration of our mirror.

      We assume this problem is related to ARCHETYPE-358.

      1. maven-archetype-delay.TXT
        32 kB
        Johannes Siebel
      2. out.txt
        59 kB
        Jörg Sesterhenn
      3. settings.xml
        2 kB
        Johannes Siebel

        Activity

        Hide
        joerg.sesterhenn Jörg Sesterhenn added a comment -

        The feature to use mirror repos for archetype-catalogs was introduced in 3.0.0 (ARCHETYPE-358). This seems to have changed the default behaviour.

        As stated in the comments to ARCHETYPE-427 you have to define a repository named "archetype" in your mirror settings or do as the warning tells you to and

        [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
        

        However as this is not well documented I guess this bug is still valid.

        Show
        joerg.sesterhenn Jörg Sesterhenn added a comment - The feature to use mirror repos for archetype-catalogs was introduced in 3.0.0 ( ARCHETYPE-358 ). This seems to have changed the default behaviour. As stated in the comments to ARCHETYPE-427 you have to define a repository named "archetype" in your mirror settings or do as the warning tells you to and [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere. However as this is not well documented I guess this bug is still valid.
        Hide
        johannes.siebel@debeka.de Johannes Siebel added a comment - - edited

        We've tried using a repository with id archetype but that didn't affect the behaviour of the archetype generation. Since we're using a wildcard mirror, the mirrors should be picked up by the archetype-plugin anyway (ref. cc7f9bc4354d7411273ceecdcb46988905c99c16).

        As I've mentioned above the plugin successfully connects to our nexus and downloads the archetype just fine. The problem is that it also tries to contact repo.maven.apache.org causing massive delays.

        The snippet below shows the issue at hand:

        [INFO] Generating project in Interactive mode
        [DEBUG] Using catalog D:\home\maven\maven-repository\archetype-catalog.xml
        [WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo.maven.apache.org/maven2).
        [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
        [DEBUG] Not found archetype com.acme.maven.archetypes.soa.properties:soa-properties-archetype:1.0.0-SNAPSHOT in cache
        [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo.maven.apache.org/maven2
        [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo.acme.com/repo/content/groups/public
        Downloading: http://repo.maven.apache.org/maven2/com/acme/maven/archetypes/soa/properties/soa-properties-archetype/1.0.0-SNAPSHOT/maven-metadata.xml
        Downloading: http://repo.acme.com/repo/content/groups/public/com/acme/maven/archetypes/soa/properties/soa-properties-archetype/1.0.0-SNAPSHOT/maven-metadata.xml
        2/2 KB   
                 
        Downloaded: http://repo.acme.com/repo/content/groups/public/com/acme/maven/archetypes/soa/properties/soa-properties-archetype/1.0.0-SNAPSHOT/maven-metadata.xml (2 KB at 10.9 KB/sec)
        
        Show
        johannes.siebel@debeka.de Johannes Siebel added a comment - - edited We've tried using a repository with id archetype but that didn't affect the behaviour of the archetype generation. Since we're using a wildcard mirror, the mirrors should be picked up by the archetype-plugin anyway (ref. cc7f9bc4354d7411273ceecdcb46988905c99c16 ). As I've mentioned above the plugin successfully connects to our nexus and downloads the archetype just fine. The problem is that it also tries to contact repo.maven.apache.org causing massive delays. The snippet below shows the issue at hand: [INFO] Generating project in Interactive mode [DEBUG] Using catalog D:\home\maven\maven-repository\archetype-catalog.xml [WARNING] Archetype not found in any catalog. Falling back to central repository (http: //repo.maven.apache.org/maven2). [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere. [DEBUG] Not found archetype com.acme.maven.archetypes.soa.properties:soa-properties-archetype:1.0.0-SNAPSHOT in cache [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http: //repo.maven.apache.org/maven2 [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http: //repo.acme.com/repo/content/groups/ public Downloading: http: //repo.maven.apache.org/maven2/com/acme/maven/archetypes/soa/properties/soa-properties-archetype/1.0.0-SNAPSHOT/maven-metadata.xml Downloading: http: //repo.acme.com/repo/content/groups/ public /com/acme/maven/archetypes/soa/properties/soa-properties-archetype/1.0.0-SNAPSHOT/maven-metadata.xml 2/2 KB Downloaded: http: //repo.acme.com/repo/content/groups/ public /com/acme/maven/archetypes/soa/properties/soa-properties-archetype/1.0.0-SNAPSHOT/maven-metadata.xml (2 KB at 10.9 KB/sec)
        Hide
        rfscholte Robert Scholte added a comment -

        What are the commandline arguments used?

        Show
        rfscholte Robert Scholte added a comment - What are the commandline arguments used?
        Hide
        johannes.siebel@debeka.de Johannes Siebel added a comment -

        The command-line arguments were:

        mvn -X archetype:generate -DarchetypeGroupId=<groupid> -DarchetypeArtifactId=<artifact-id> -DarchetypeVersion=1.0.0-SNAPSHOT -DinteractiveMode=true -DarchetypeCatalog=local

        For the record: specifying the parameter -DarchetypeCatalog=local does not change the behaviour.

        Show
        johannes.siebel@debeka.de Johannes Siebel added a comment - The command-line arguments were: mvn -X archetype:generate -DarchetypeGroupId=<groupid> -DarchetypeArtifactId=<artifact-id> -DarchetypeVersion=1.0.0-SNAPSHOT -DinteractiveMode= true -DarchetypeCatalog=local For the record: specifying the parameter -DarchetypeCatalog=local does not change the behaviour.
        Hide
        joerg.sesterhenn Jörg Sesterhenn added a comment -

        Robert Scholte: Any news on this? This slows down builds considerably. Could you reproduce the issue with the provided settings?

        Show
        joerg.sesterhenn Jörg Sesterhenn added a comment - Robert Scholte : Any news on this? This slows down builds considerably. Could you reproduce the issue with the provided settings?
        Hide
        rfscholte Robert Scholte added a comment -

        I've been working on inproving the set of intregration tests, but the current SNAPSHOT seems to go to the mirror as expected. Will need to investigate a bit more.

        Show
        rfscholte Robert Scholte added a comment - I've been working on inproving the set of intregration tests, but the current SNAPSHOT seems to go to the mirror as expected. Will need to investigate a bit more.
        Hide
        joerg.sesterhenn Jörg Sesterhenn added a comment -

        Robert Scholte: Just to be clear on that - the mirrors are used at our site as well. They are just not used exclusively which is the problem.
        Did you use the <mirrorOf>*</mirrorOf> setting in your tests? (How) can we run these integration tests at our site to see if we get the same result?

        Show
        joerg.sesterhenn Jörg Sesterhenn added a comment - Robert Scholte : Just to be clear on that - the mirrors are used at our site as well. They are just not used exclusively which is the problem. Did you use the <mirrorOf>*</mirrorOf> setting in your tests? (How) can we run these integration tests at our site to see if we get the same result?
        Hide
        rfscholte Robert Scholte added a comment -

        I'm working on some new features to the mock repository manager to have an isolated environment which works for archetype as well.
        If you want to test right now: install mrm yourself
        https://git-wip-us.apache.org/repos/asf/maven-archetype.git has a branch called ARCHETYPE-520. IIUC that contains an integration-test which matches this usecase.
        That should confirm that the mirror is working as expected, unless you can show me otherwise.

        Show
        rfscholte Robert Scholte added a comment - I'm working on some new features to the mock repository manager to have an isolated environment which works for archetype as well. If you want to test right now: install mrm yourself https://git-wip-us.apache.org/repos/asf/maven-archetype.git has a branch called ARCHETYPE-520 . IIUC that contains an integration-test which matches this usecase. That should confirm that the mirror is working as expected, unless you can show me otherwise.
        Hide
        joerg.sesterhenn Jörg Sesterhenn added a comment -

        Robert Scholte: I attached the output of mvn clean install on this branch to the issue as out.txt.

        Show
        joerg.sesterhenn Jörg Sesterhenn added a comment - Robert Scholte : I attached the output of mvn clean install on this branch to the issue as out.txt.
        Hide
        rfscholte Robert Scholte added a comment -

        Jörg Sesterhenn please run it as mvn clean verify -Prun-its (always avoid install). And there's an issue with long paths on Windows, which makes one test fail. If the absolute path of the root folder is 20 characters or less it should succeed.

        Show
        rfscholte Robert Scholte added a comment - Jörg Sesterhenn please run it as mvn clean verify -Prun-its (always avoid install ). And there's an issue with long paths on Windows, which makes one test fail. If the absolute path of the root folder is 20 characters or less it should succeed.
        Hide
        rfscholte Robert Scholte added a comment -
        Show
        rfscholte Robert Scholte added a comment - Fixed in f831932cef0709cf72609d8e23169b5a4c01649f
        Hide
        johannes.siebel@debeka.de Johannes Siebel added a comment -

        Robert, thanks a lot for taking care of this issue. Can you elaborate on what caused this problem? The commit linked above only lists files for the integration tests, there is no obvious indication of a fix there (unless I'm mistaken, then I'd appreciate if you could point out the fix for me).

        Show
        johannes.siebel@debeka.de Johannes Siebel added a comment - Robert, thanks a lot for taking care of this issue. Can you elaborate on what caused this problem? The commit linked above only lists files for the integration tests, there is no obvious indication of a fix there (unless I'm mistaken, then I'd appreciate if you could point out the fix for me).
        Hide
        rfscholte Robert Scholte added a comment -

        The fix for ARCHETYPE-518 is the base for all repository related issues.

        Show
        rfscholte Robert Scholte added a comment - The fix for ARCHETYPE-518 is the base for all repository related issues.
        Hide
        johannes.siebel@debeka.de Johannes Siebel added a comment -

        We tested the SNAPSHOT and our problem seems to be fixed indeed. Thanks again, Robert,

        Show
        johannes.siebel@debeka.de Johannes Siebel added a comment - We tested the SNAPSHOT and our problem seems to be fixed indeed. Thanks again, Robert,
        Hide
        rfscholte Robert Scholte added a comment -

        Thanks for the confirmation, will prepare a new release within a couple of days

        Show
        rfscholte Robert Scholte added a comment - Thanks for the confirmation, will prepare a new release within a couple of days

          People

          • Assignee:
            rfscholte Robert Scholte
            Reporter:
            johannes.siebel@debeka.de Johannes Siebel
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development