This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 213078 - 'name' property not being picked up from mirror of central repository from settings.xml
Summary: 'name' property not being picked up from mirror of central repository from se...
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-28 10:09 UTC by clogs
Modified: 2013-01-15 07:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description clogs 2012-05-28 10:09:27 UTC
Product Version = NetBeans IDE 7.2 Beta (Build 201205031832)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_31
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.6-b01

I have the following mirror definition for the central Maven repository (in my local settings.xml):

<mirrors>	
    <mirror>
        <id>UK</id>
        <mirrorOf>central</mirrorOf>
        <name>UK Central Maven Repository</name>
       <url>http://uk.maven.org/maven2/</url>
    </mirror>
</mirrors>

In the 'Services/Maven Repositories' node I can see the 'UK' repository. If I then right-click and select properties, it does not show the name specified above, it only shows 'UK'.
Comment 1 Jesse Glick 2012-05-29 21:53:54 UTC
A related problem (mentioned in TransientRepositoriesTest) is that given e.g.

        <mirror>
            <id>netbeans</id>
            <mirrorOf>netbeans</mirrorOf>
            <url>http://localhost:8080/nexus/content/repositories/netbeans/</url>
        </mirror>

when opening a project specifying

        <repository>
            <id>netbeans</id>
            <name>NetBeans</name>
            <url>http://bits.netbeans.org/maven2/</url>
        </repository>

you might expect the Maven Repositories subnode to be shown as "NetBeans", but it is shown as "netbeans" instead - i.e. <name> from <repository> is also ignored. Same without an explicit <repository> definition - "Central Repository" from the superpom should be used, but is not. Regression from one of the mirror handling changes in 7.2.
Comment 2 Milos Kleint 2012-05-31 09:12:39 UTC
in case of mirrors and showing what gets mirrored, I believe showing the Id is better because
1. it's shorter, in case of mutiple mirrored repos the node name can get big
2. it's more explicit. the <id> element is mandatory, while name isn't. That means there can be multiple repository definitions with id=my-snashots, some with a name some without (or with clashing names)
3. showing Ids can also help when determining what gets mirrored through which mirror, thus what value of <mirrorOf> does what and what to write there.
Comment 3 clogs 2012-05-31 17:49:10 UTC
Agreed, but that's not what the original bug report is about. That is about the name not showing up in the properties of the repository.
Comment 4 Jesse Glick 2012-05-31 21:44:41 UTC
(In reply to comment #2)
> 1. it's shorter, in case of mutiple mirrored repos the node name can get big

Was not suggesting a change of behavior in case of multiple mirrored repos - only when the mirror is for a single repo.

> 2. it's more explicit. the <id> element is mandatory, while name isn't.

So? This is just about display; the Maven Repos node will always show one item per ID anyway. Remember that when there are no mirrors in site, a poorly managed project (or set of projects) could have several unrelated repositories with the same <name>, but no one has ever complained about this.

> 3. showing Ids can also help when determining what gets mirrored through which
> mirror, thus what value of <mirrorOf> does what and what to write there.

Then show mirror IDs separately in a tool tip or something. It is not what you want to look at primarily when your mental model is of repositories; when there are 1-1 mirrors, these are often just a performance optimization.
Comment 5 Milos Kleint 2013-01-14 12:23:53 UTC
http://hg.netbeans.org/core-main/rev/d2987417b9aa

for mirrors we lookup the name correctly now.
Comment 6 Quality Engineering 2013-01-15 07:27:37 UTC
Integrated into 'main-golden', will be available in build *201301150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d2987417b9aa
User: Milos Kleint <mkleint@netbeans.org>
Log: #213078 need to lookup name of mirror from the list of mirrors, ArtifactRepository doesn't contain it.