[ 
http://jira.codehaus.org/browse/ARCHETYPE-366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=259568#action_259568
 ] 

Jesse Glick commented on ARCHETYPE-366:
---------------------------------------

This repo ID and URL are predefined in Maven so it may not matter that the ID 
is not specified on the command line. Anyway the mirror of Central _does_ kick 
in when I am offline.

Using {{-X}} shows:

{noformat}
...
[DEBUG] Configuring mojo 
'org.apache.maven.plugins:maven-archetype-plugin:2.0:generate' with basic 
configurator -->
...
[DEBUG]   (f) archetypeCatalog = remote,local
...
[DEBUG]   (f) archetypeRepository = http://repo1.maven.org/maven2/
...
[DEBUG]   (f) remoteArtifactRepositories = [       id: central
      url: .../nexus/content/repositories/central/
   layout: default
snapshots: [enabled => true, update => daily]
 releases: [enabled => true, update => daily]
]
...
[INFO] Archetype defined by properties
[DEBUG] Not found archetype org.codehaus.mojo.archetypes:osgi-archetype:1.2 in 
cache
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for 
http://repo1.maven.org/maven2/
Downloading: 
http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
Downloaded: 
http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
 (4 KB at 11.0 KB/sec)
[DEBUG] Reading resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar.lastUpdated
[DEBUG] Writing resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for 
http://repo1.maven.org/maven2/
Downloading: 
http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
Downloaded: 
http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
 (947 B at 7.6 KB/sec)
[DEBUG] Reading resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom.lastUpdated
[DEBUG] Writing resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom.lastUpdated
[DEBUG] Found archetype org.codehaus.mojo.archetypes:osgi-archetype:1.2 in 
cache: 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
...
{noformat}

When online:

{noformat}
...
[DEBUG] Not found archetype org.codehaus.mojo.archetypes:osgi-archetype:1.2 in 
cache
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for 
http://repo1.maven.org/maven2/
Downloading: 
http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
[DEBUG] Reading resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar.lastUpdated
[DEBUG] Writing resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for 
.../nexus/content/repositories/central/
Downloading: 
.../nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
Downloaded: 
.../nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
 (4 KB at 159.4 KB/sec)
[DEBUG] Reading resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar.lastUpdated
[DEBUG] Writing resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for 
http://repo1.maven.org/maven2/
Downloading: 
http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
[DEBUG] Reading resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom.lastUpdated
[DEBUG] Writing resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for 
.../nexus/content/repositories/central/
Downloading: 
.../nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
Downloaded: 
.../nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
 (947 B at 92.5 KB/sec)
[DEBUG] Reading resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom.lastUpdated
[DEBUG] Writing resolution tracking file 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom.lastUpdated
[DEBUG] Found archetype org.codehaus.mojo.archetypes:osgi-archetype:1.2 in 
cache: 
.../.m2/repository/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
...
{noformat}


> Maven mirror consulted after, rather than instead of, archetypeRepository URL
> -----------------------------------------------------------------------------
>
>                 Key: ARCHETYPE-366
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-366
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0
>         Environment: Ubuntu 10.04, JDK 6.
>            Reporter: Jesse Glick
>            Priority: Minor
>
> I have a local Nexus instance running, with a mirror of Central, and in 
> {{settings.xml}}:
> {noformat}
> <mirror>
>     <id>central</id>
>     <mirrorOf>central</mirrorOf>
>     <url>.../content/repositories/central/</url>
> </mirror>
> {noformat}
> This works fine for normal Maven operations. However, {{archetype:generate}} 
> tries to download from the public repo _first_. So when I am online, after 
> typing this:
> {noformat}
> rm -rf ~/.m2/repository/org/codehaus/mojo/archetypes test
> mvn -DarchetypeVersion=1.2 -Darchetype.interactive=false -DgroupId=test 
> -DarchetypeArtifactId=osgi-archetype 
> -DarchetypeRepository=http://repo1.maven.org/maven2/ -Dversion=1.0-SNAPSHOT 
> -DarchetypeGroupId=org.codehaus.mojo.archetypes -Dbasedir=/tmp -Dpackage=test 
> -DartifactId=test --batch-mode archetype:generate
> {noformat}
> I see:
> {noformat}
> [INFO] Archetype defined by properties
> Downloading: 
> http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
> Downloaded: 
> http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
>  (4 KB at 8.7 KB/sec)
> Downloading: 
> http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
> Downloaded: 
> http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
>  (947 B at 8.3 KB/sec)
> {noformat}
> with no mention of Nexus; when I am offline:
> {noformat}
> [INFO] Archetype defined by properties
> Downloading: 
> http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
> Downloading: 
> http://localhost:6969/nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
> Downloaded: 
> http://localhost:6969/nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.jar
>  (4 KB at 128.8 KB/sec)
> Downloading: 
> http://repo1.maven.org/maven2/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
> Downloading: 
> http://localhost:6969/nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
> Downloaded: 
> http://localhost:6969/nexus/content/repositories/central/org/codehaus/mojo/archetypes/osgi-archetype/1.2/osgi-archetype-1.2.pom
>  (947 B at 57.8 KB/sec)
> {noformat}
> once this resource is cached in the Nexus mirror repo. (Since the online 
> command does not ask Nexus, it normally is _not_ cached there and offline 
> project creation simply fails; to force Nexus to cache it, I need to ask 
> Maven to download it as a dep of something.)
> If I do not specify an explicit {{archetypeRepository}} then I get
> {noformat}
> [INFO] Archetype repository missing. Using the one from 
> [org.codehaus.mojo.archetypes:osgi-archetype:1.2] found in catalog remote
> {noformat}
> and Nexus is consulted first, but this parameter is needed as a workaround 
> for ARCHETYPE-344.
> One complicating factor with this example is that the 1.2 release of the 
> archetype does not seem to be present in the Central index; I have no clue 
> why. (It was released on February 15, i.e. more than three weeks ago, and my 
> understanding is that the index is rebuilt weekly.) May not have anything to 
> do with this bug, though.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to