Skip to content

Commit

Permalink
Allow dynamic ports to be override by System properties.
Browse files Browse the repository at this point in the history
Previous behavior only allowed project properties to override them.
Even the documentation suggested that you could override them by passing
-Dfoo=bar on the mvn cli, but this wasn't actually the case.

Signed-off-by: Ben Reser <ben.reser@cdk.com>
  • Loading branch information
Ben Reser committed May 7, 2015
1 parent 58d441f commit d84bc05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/jolokia/docker/maven/StartMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ public void executeInternal(DockerAccess docker) throws DockerAccessException, M
checkImageWithAutoPull(docker, imageName, getRegistry(imageConfig));

RunImageConfiguration runConfig = imageConfig.getRunConfiguration();
PortMapping mappedPorts = getPortMapping(runConfig, project.getProperties());
Properties properties = new Properties();
properties.putAll(project.getProperties());
properties.putAll(System.getProperties());
PortMapping mappedPorts = getPortMapping(runConfig, properties);

String name = calculateContainerName(imageConfig.getAlias(), runConfig.getNamingStrategy());
ContainerCreateConfig config = createContainerConfig(docker, imageName, runConfig, mappedPorts);
Expand Down

0 comments on commit d84bc05

Please sign in to comment.