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 202703 - MavenEmbedder.resolve ignoring mirror settings
Summary: MavenEmbedder.resolve ignoring mirror settings
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 195296
  Show dependency tree
 
Reported: 2011-09-26 22:25 UTC by Jesse Glick
Modified: 2011-11-03 15:34 UTC (History)
0 users

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 Jesse Glick 2011-09-26 22:25:03 UTC
E.g. from MavenSourceJavadocAttacher, resolving javax.help:javahelp:2.0.05:sources:jar does not work, at least not with my Nexus config.

One problem is likely that if there is no (Maven) project open - e.g. because you are just browsing a class opened from a JAR in Local - MSJA lists no remote repositories, whereas it ought to list central (mentioned in _maven.repositories); can be solved in the case of central by just hardcoding that id, but not clear how to solve generally, except by giving a remote repo with a dummy URL and the right ID and hoping there is a mirror definition.

But even with a project open, it still does not work. ME.resolve apparently ought to be populating more fields in the ArtifactResolutionRequest, but that does not suffice.
Comment 1 Jesse Glick 2011-09-26 23:26:00 UTC
(In reply to comment #0)
> if there is no (Maven) project open

Punting on this for now; various things do not work unless appropriate repos are defined.

> that does not suffice.

Seems those fields are ignored, but are searched for in the RepositorySystemSession.
Comment 2 Jesse Glick 2011-09-26 23:26:46 UTC
core-main #9d464b81555e
Comment 3 Quality Engineering 2011-09-27 14:13:56 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/9d464b81555e
User: Jesse Glick <jglick@netbeans.org>
Log: #202703: MavenEmbedder.resolve not working
Comment 4 Jesse Glick 2011-11-02 20:08:54 UTC
Not working today. org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve gets a RepositorySystemSession with the correct mirrors configured, but its Collection<? extends ArtifactRequest> refer to the unmirrored location, and it does not itself seem to consult mirrors. No idea how I made it work before.
Comment 5 Jesse Glick 2011-11-02 23:23:55 UTC
Weirder - it seems that EmbedderFactory.createRemoteRepository sometimes, but not always, replaced the URL in a repo with that of its mirror. When it works, it is because DefaultArtifactRepositoryFactory.injectSession replaces the repo URL with its mirror. Seems that it all depends on whether legacy support was yet set up in the current thread.
Comment 6 Jesse Glick 2011-11-02 23:26:22 UTC
core-main #3ea001430dd6
Comment 7 Quality Engineering 2011-11-03 15:34:12 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/3ea001430dd6
User: Jesse Glick <jglick@netbeans.org>
Log: #202703: MavenEmbedder.resolve ignoring mirror settings