@Override
    protected void executeInternal(ServiceHub serviceHub) throws DockerAccessException, MojoExecutionException {
        if (getVolumes() == null) {
            log.info("No volume configuration found.");
            return;
        }
        VolumeService volService = serviceHub.getVolumeService();

        for (VolumeConfiguration volume : getVolumes()) {
            log.info("Creating volume '%s'", volume.getName());
            volService.createVolume(volume);
        }
    }
Mojo to create named volumes, useful for preparing integration tests

@author Tom Burton
@version Dec 15, 2016
src/main/java/io/fabric8/maven/docker/VolumeCreateMojo.java