You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hervé Boutemy (JIRA)" <ji...@apache.org> on 2017/05/20 08:48:04 UTC

[jira] [Comment Edited] (ARCHETYPE-204) Add option to use remote repositories that are password protected

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

Hervé Boutemy edited comment on ARCHETYPE-204 at 5/20/17 8:47 AM:
------------------------------------------------------------------

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:
{code:xml}<server>
      <id><archetype name>-repo</id>
      <username>myuser</username>
      <password>XXXXXX</password>
      <filePermissions>664</filePermissions>
      <directoryPermissions>775</directoryPermissions>
      <configuration></configuration>
</server>{code}

2. Run the generate command:
{code}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{code}

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



was (Author: jdiazch):
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


> Add option to use remote repositories that are password protected
> -----------------------------------------------------------------
>
>                 Key: ARCHETYPE-204
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-204
>             Project: Maven Archetype
>          Issue Type: Improvement
>          Components: Generator
>    Affects Versions: 2.0-alpha-3
>         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"
>            Reporter: Martin Tilma
>            Assignee: Robert Scholte
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> When the archetype's are in a password protected repository you can't download the archetype 
> Command used: {noformat}mvn archetype:generate -DarchetypeGroupId=nl.func.quickstart -DarchetypeArtifactId=quickstart -DarchetypeVersion=1.0 -DgroupId=nl.func.test -DartifactId=apple -DarchetypeRepository=https://maven.func.nl{noformat}
> 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:
> {noformat}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{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)