{"action":"created","issue":{"url":"https://api.github.com/repos/mguymon/naether/issues/16","labels_url":"https://api.github.com/repos/mguymon/naether/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/mguymon/naether/issues/16/comments","events_url":"https://api.github.com/repos/mguymon/naether/issues/16/events","html_url":"https://github.com/mguymon/naether/issues/16","id":52835840,"number":16,"title":"NPE while accessing a repository requiring authentication","user":{"login":"cpotter1","id":668663,"avatar_url":"https://avatars.githubusercontent.com/u/668663?v=3","gravatar_id":"","url":"https://api.github.com/users/cpotter1","html_url":"https://github.com/cpotter1","followers_url":"https://api.github.com/users/cpotter1/followers","following_url":"https://api.github.com/users/cpotter1/following{/other_user}","gists_url":"https://api.github.com/users/cpotter1/gists{/gist_id}","starred_url":"https://api.github.com/users/cpotter1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpotter1/subscriptions","organizations_url":"https://api.github.com/users/cpotter1/orgs","repos_url":"https://api.github.com/users/cpotter1/repos","events_url":"https://api.github.com/users/cpotter1/events{/privacy}","received_events_url":"https://api.github.com/users/cpotter1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-24T20:34:30Z","updated_at":"2015-01-06T00:53:50Z","closed_at":null,"body":"I added a repository that requires authentication and I noticed two issues.\r\n\r\nFirst, since maven central does not have this particular artifact, you get a NPE.  I then decided to reorder the remote repository list (since Naether is using a LinkedHashSet) and got a little further.  Here is the code I used to reverse order the repos:\r\n```java\r\n    // hack to force central to be last\r\n    Set<RemoteRepository> remotes = instance.getRemoteRepositories();\r\n    List<RemoteRepository> remotesList = new ArrayList<RemoteRepository>(remotes);\r\n    Collections.reverse(remotesList);\r\n    instance.setRemoteRepositories(new LinkedHashSet<RemoteRepository>(remotesList));\r\n```\r\n\r\nAfter this I became blocked on the issue with the NPE related to authentication.  Seems like its happening in the Aether / wagon code though.\r\n\r\nCaused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact com.xyz.mmx:mmx-client-java:pom:2.3.98_D1_RC1 from/to dev-repo.xyz.com-artifactory-everything--8081 (http://dev-repo.xyz.com:8081/artifactory/everything/): NullPointerException\r\n\tat org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)\r\n\tat org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)\r\n\tat org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)\r\n\tat org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:744)\r\nCaused by: java.lang.NullPointerException: null\r\n\tat org.apache.maven.wagon.providers.http.LightweightHttpWagon.openConnectionInternal(LightweightHttpWagon.java:276)\r\n\tat org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:115)\r\n\tat org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:217)\r\n\tat org.sonatype.aether.connector.wagon.WagonRepositoryConnector.connectWagon(WagonRepositoryConnector.java:345)\r\n\tat org.sonatype.aether.connector.wagon.WagonRepositoryConnector.pollWagon(WagonRepositoryConnector.java:385)\r\n\tat org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:571)\r\n\tat org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n\tat java.lang.Thread.run(Thread.java:744)\r\n\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/mguymon/naether/issues/comments/68809873","html_url":"https://github.com/mguymon/naether/issues/16#issuecomment-68809873","issue_url":"https://api.github.com/repos/mguymon/naether/issues/16","id":68809873,"user":{"login":"mguymon","id":2565,"avatar_url":"https://avatars.githubusercontent.com/u/2565?v=3","gravatar_id":"","url":"https://api.github.com/users/mguymon","html_url":"https://github.com/mguymon","followers_url":"https://api.github.com/users/mguymon/followers","following_url":"https://api.github.com/users/mguymon/following{/other_user}","gists_url":"https://api.github.com/users/mguymon/gists{/gist_id}","starred_url":"https://api.github.com/users/mguymon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mguymon/subscriptions","organizations_url":"https://api.github.com/users/mguymon/orgs","repos_url":"https://api.github.com/users/mguymon/repos","events_url":"https://api.github.com/users/mguymon/events{/privacy}","received_events_url":"https://api.github.com/users/mguymon/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T00:53:50Z","updated_at":"2015-01-06T00:53:50Z","body":"released 0.13.7"}}