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
Conversation
…itories, including Jetty test server.
|
||
mojo.execute(); | ||
|
||
server.stop(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 )
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an emty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line added!
Fixed in e897911 |
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.
This new pull request makes pull request #18 redundant.
It includes now a Jetty server on port 8000 to test the authentication.