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

[MDEP-579] - Add mirrors, proxies and authentication for remote repositories. #19

Closed
wants to merge 2 commits into from

Conversation

pmoerenhout
Copy link
Contributor

This new pull request makes pull request #18 redundant.

It includes now a Jetty server on port 8000 to test the authentication.


mojo.execute();

server.stop();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls call it within the finally block. This is a typical problem of integration tests that they failed and the server is never stopped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the server.stop() to a finally block.

public void testRemoteRepositoriesAuthentication()
throws Exception
{
org.eclipse.jetty.server.Server server = createServer( 8000 );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A concrete prort cannot be. We use the wildcard port 0.0.0.0 and the client connects to the server's local port.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I start the server now with a random port, and use server.getURI() to generate the remoteRepositories parameter.

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to have a plugin for this. This is enough:

  <properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

server.setId( "myserver" );
server.setUsername( "foo" );
server.setPassword( "bar" );
settings.addServer(server);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add spaces like his: settings.addServer( server )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -150,4 +192,47 @@ public void testParseRepository()
// expected
}
}

private ContextHandler createContextHandler() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same here (spaces).
Bracket should be on a new line:

private ContextHandler createContextHandler()
{

# under the License.

# username: password[,rolename ...]
foo: bar,userrole
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an emty line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line added!

@rfscholte
Copy link
Contributor

Fixed in e897911

@rfscholte rfscholte closed this Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants