Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with repository mirror requiring credentials #27

Open
ginkel opened this issue Sep 4, 2020 · 1 comment
Open

Dealing with repository mirror requiring credentials #27

ginkel opened this issue Sep 4, 2020 · 1 comment

Comments

@ginkel
Copy link

ginkel commented Sep 4, 2020

Hi there,

I am trying to get integration testing working as outlined in the README.

@RunWith(MavenJUnitTestRunner.class)
@MavenVersions({"3.6.3"})
class CobolCopyToJavaMojoTest {

  @Rule
  public final TestResources resources = new TestResources();

  public final MavenRuntime maven;

  public CobolCopyToJavaMojoTest(MavenRuntimeBuilder mavenBuilder) throws Exception {
    this.maven = mavenBuilder.withCliOptions("-B", "-U").build();
  }

  @Test
  void test() {
    [...]
  }
}

Unfortunately, this does not seem to work when there is a mirror configured that needs credentials:

java.lang.Exception: Could not resolve maven version 3.6.3

	at io.takari.maven.testing.executor.junit.MavenJUnitTestRunner$1.error(MavenJUnitTestRunner.java:129)
	at io.takari.maven.testing.executor.junit.MavenVersionResolver.resolve(MavenVersionResolver.java:105)
	at io.takari.maven.testing.executor.junit.MavenJUnitTestRunner.getRunners(MavenJUnitTestRunner.java:131)
	at io.takari.maven.testing.executor.junit.MavenJUnitTestRunner.<init>(MavenJUnitTestRunner.java:89)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
	at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28)
	at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:50)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.io.FileNotFoundException: Could not download maven version 3.6.3 from any configured repository
	at io.takari.maven.testing.executor.junit.MavenVersionResolver.createMavenInstallation(MavenVersionResolver.java:272)
	at io.takari.maven.testing.executor.junit.MavenVersionResolver.resolve(MavenVersionResolver.java:103)
	... 18 more
Caused by: java.io.IOException: HTTP/401 Unauthorized
	at io.takari.maven.testing.executor.junit.MavenVersionResolver.openStream(MavenVersionResolver.java:314)
	at io.takari.maven.testing.executor.junit.MavenVersionResolver.createMavenInstallation(MavenVersionResolver.java:255)
	... 19 more

Any ideas?

@TobiX
Copy link

TobiX commented Feb 5, 2022

You are probably hit by a similar issue as #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants