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

Add option to use remote repositories that are password protected

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-alpha-3
    • Fix Version/s: 3.0.0
    • Component/s: Generator
    • Labels:
      None
    • Environment:
       mvn -version
      Maven version: 2.0.9
      Java version: 1.6.0_06
      OS name: "linux" version: "2.6.24-19-generic" arch: "i386" Family: "unix"

      Description

      When the archetype's are in a password protected repository you can't download the archetype

      Command used:

      mvn archetype:generate -DarchetypeGroupId=nl.func.quickstart -DarchetypeArtifactId=quickstart -DarchetypeVersion=1.0 -DgroupId=nl.func.test -DartifactId=apple -DarchetypeRepository=https://maven.func.nl

      There is a "archetypeRepository" option, but there is no option to bind a server id from the settings.xml.

      Could this, or some other solution, be added?

      My current workaround is to use scpexe instead of https.

      Command used:

      mvn archetype:generate -DarchetypeGroupId=nl.func.quickstart -DarchetypeArtifactId=quickstart -DarchetypeVersion=1.0 -DgroupId=nl.func.test -DartifactId=apple -DarchetypeRepository=scpexe://maven.func.nl/var/sites/nl.func.maven/www/ -Darchetype.interactive=false

        Issue Links

          Activity

          Hide
          jdiazch Javier Diaz added a comment -

          I managed to run the command against an authenticated repository creating an entry in settings file with id <archetype-name>-repo. Detailed steps:

          1. Add an entry in settings.xml file:
          <server>
          <id><archetype name>-repo</id>
          <username>myuser</username>
          <password>XXXXXX</password>
          <filePermissions>664</filePermissions>
          <directoryPermissions>775</directoryPermissions>
          <configuration></configuration>
          </server>

          2. Run the generate command:
          mvn archetype:generate -DarchetypeGroupId=mygroup \
          -DarchetypeArtifactId=<archetype-name> \
          -DarchetypeVersion=XXXXX -DgroupId=com.abc \
          -DartifactId=dummy \
          -Dversion=1.0.0-SNAPSHOT \
          -DarchetypeRepository=http://www.abc.com/maven2 \

          And that did the trick.

          I couldn't find any documentation of this. You can take a look at the class DefaultArchetypeGenerationConfigurator.

          Plugin version: 2.0-alpha-4

          Show
          jdiazch Javier Diaz added a comment - I managed to run the command against an authenticated repository creating an entry in settings file with id <archetype-name>-repo. Detailed steps: 1. Add an entry in settings.xml file: <server> <id><archetype name>-repo</id> <username>myuser</username> <password>XXXXXX</password> <filePermissions>664</filePermissions> <directoryPermissions>775</directoryPermissions> <configuration></configuration> </server> 2. Run the generate command: mvn archetype:generate -DarchetypeGroupId=mygroup \ -DarchetypeArtifactId=<archetype-name> \ -DarchetypeVersion=XXXXX -DgroupId=com.abc \ -DartifactId=dummy \ -Dversion=1.0.0-SNAPSHOT \ -DarchetypeRepository= http://www.abc.com/maven2 \ And that did the trick. I couldn't find any documentation of this. You can take a look at the class DefaultArchetypeGenerationConfigurator. Plugin version: 2.0-alpha-4
          Hide
          jdiazch Javier Diaz added a comment -

          Created jira issue for the documentation: #ARCHETYPE-206

          Show
          jdiazch Javier Diaz added a comment - Created jira issue for the documentation: # ARCHETYPE-206
          Hide
          sslavic Stevo Slavic added a comment -

          ARCHETYPE-220 contains a patch which adds support for specifying archetypeRepositoryId

          Show
          sslavic Stevo Slavic added a comment - ARCHETYPE-220 contains a patch which adds support for specifying archetypeRepositoryId
          Hide
          Lukino Lukas Krupa added a comment - - edited

          This is a very annoying bug. Any update on this ?

          There are few other workarounds, but it will be nice to have this fixed if you plan to distribute own archetypes within company. Then people doesn't have to remember GAV or nexus URL..

          Show
          Lukino Lukas Krupa added a comment - - edited This is a very annoying bug. Any update on this ? There are few other workarounds, but it will be nice to have this fixed if you plan to distribute own archetypes within company. Then people doesn't have to remember GAV or nexus URL..
          Hide
          rfscholte Robert Scholte added a comment -

          With 3.0.0 it is not possible to specify the archetype as a URL. Instead the repository named 'archetype' (or otherwise 'central') is used to get the archetype. Mirrors, proxy and authentication from settings.xml is respected.

          Show
          rfscholte Robert Scholte added a comment - With 3.0.0 it is not possible to specify the archetype as a URL. Instead the repository named 'archetype' (or otherwise 'central') is used to get the archetype. Mirrors, proxy and authentication from settings.xml is respected.

            People

            • Assignee:
              rfscholte Robert Scholte
              Reporter:
              martintilma Martin Tilma
            • Votes:
              8 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development