shdqcdsn / counterclockwise

Automatically exported from code.google.com/p/counterclockwise
0 stars 0 forks source link

"Multiple mirrors configured to match repository" error #672

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create ~/.lein/profiles.clj with a corporate repo mirror, e.g.

{:user 
  {:mirrors {#".+" {:url "http://<host>/nexus/content/groups/public/"}}}
}

(source: 
http://stackoverflow.com/questions/22716492/how-to-configure-leiningen-to-use-a-
corporate-repository, comment #2)

2. Launch Eclipse with CCW installed

What is the expected output? What do you see instead?

Expected: no errors, and corporate repo is used to download all dependencies 
for all projects

Actual: 
Leiningen Managed Dependencies issue: unknown problem: 
Multiple mirrors configured to match repository {"central" 
"https://repo1.maven.org/maven2/"}: 
{#".+" {:url "http://<host>/nexus/content/groups/public/"}, 
 #".+" {:url "http://<host>/nexus/content/groups/public/"}}

What version of the product are you using? On what operating system?
0.30.0.STABLE001 on Linux x86_64, Fedora 20

Please provide any additional information below.

Original issue reported on code.google.com by abco...@gmail.com on 24 Nov 2014 at 12:19

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 29 Nov 2014 at 9:48

GoogleCodeExporter commented 9 years ago
I did a test by entering http://clojars.org/repo/ as you did, in the 
profiles.clj file, and was not able to reproduce the issue.
Would it be possible that you effectively have duplicate entries through 
different profiles.clj ?

Original comment by laurent....@gmail.com on 29 Nov 2014 at 10:01

GoogleCodeExporter commented 9 years ago
I can reproduce the issue if e.g. I set the :mirrors {#".+" {:url 
"http://clojars.org/repo"}} in both places: ~/.lein/profiles.clj and my 
project.clj file.

Maybe you have some plugin that adds your enterprise mirror, or you left it in 
the project.clj ?

Original comment by laurent....@gmail.com on 29 Nov 2014 at 10:10

GoogleCodeExporter commented 9 years ago
I'm having this issue as well.  I have the following for my profiles.clj:

{:user
    {
        :mirrors {
            #".+" "http://<my-nexus-url>/nexus/content/groups/public/"
        }
    }
}

If I try to use Eclipse to create a new project or to import a project I 
already created with lein, I receive:

Caused by: java.lang.IllegalArgumentException: Multiple mirrors configured to 
match repository {"central" "https://repo1.maven.org/maven2/"}: {"central" 
{:url "http://<my-nexus-url>/nexus/content/groups/public/"}}
    at cemerick.pomegranate.aether$mirror_selector_fn.invoke(aether.clj:473)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$partial$fn__4228.doInvoke(core.clj:2468)
...

Lein works fine on the command line and does not have this problem.  I'm on 
0.31.1.STABLE001 of Counterclockwise.  In the previous you mention something 
about a plugin adding a mirror?  Is there any chance that the Maven plugin 
could interact?  Possibly via my settings.xml which also has this mirror 
configuration?  I do not have any mirrors set in my project.clj files.

I'm new to Clojure and Lein, but it should not be reading my settings.xml from 
Maven, right?

Original comment by timothy....@gmail.com on 19 Dec 2014 at 2:09

GoogleCodeExporter commented 9 years ago
Ok....I didn't expect it to make a difference, but I removed my <mirrors> 
section from my .m2/settings.xml file just in case Eclipse was letting it 
conflict and it didn't make a difference.

I've also trying making my Eclipse point directly at my 
leiningen-2.5.0-standalone jar in my preferences.

Are there any other suggestions that could help troubleshoot?

Original comment by timothy....@gmail.com on 19 Dec 2014 at 2:16

GoogleCodeExporter commented 9 years ago
Alas, I tried again and was not able to reproduce the issue.

I create a ~/.lein/profiles.clj file, and put the content you've provided in 
there (I set the clojars repository for the test, http://clojars.org/repo ).

But I get another error, saying that some dependencies are not found in clojars 
(normal).

What do you get if instead of your nexus-url you set the clojars repo url ?

Original comment by laurent....@gmail.com on 20 Dec 2014 at 6:19

GoogleCodeExporter commented 9 years ago
Hi there, 

I updated my profiles.clj to change the repo url to "http://clojars.org/repo", 
but I still get the same error (adjusted for the url):

Leiningen Managed Dependencies issue: unknown problem: 
Multiple mirrors configured to match repository {"central" 
"https://repo1.maven.org/maven2/"}: 
{#".+" {:url "http://clojars.org/repo"}, 
 #".+" {:url "http://clojars.org/repo"}}

This was with 0.31.1.STABLE001 on Linux x86_64, Fedora 21

Thanks,

Original comment by abco...@gmail.com on 9 Feb 2015 at 2:20

GoogleCodeExporter commented 9 years ago
Is there a way to tell at runtime what version of leiningen counterclockwise 
uses when setting up the project? This seems like it might be related to this 
issue: https://github.com/heroku/heroku-buildpack-clojure/issues/31, which 
should be fixed in leiningen 2.5.0. I tried changing the leiningen jar in the 
eclipse preferences to use that version, but I'm still wondering if that's 
actually the code counterclockwise is using. It'd be nice if somewhere we could 
get a log of the versions of clojure and leiningen when running an actual 
command like 'Reset project configuration'

Original comment by EricKu...@gmail.com on 23 Feb 2015 at 11:19