try
{
final File installDirectory = new File(this.installDirectory);
if (!installDirectory.exists() || !installDirectory.isDirectory())
{
throw new MojoExecutionException("'" + installDirectory + "' is not a valid install directory");
}
Artifact artifact = this.project.getArtifact();
final String path = this.replaceExtension(
artifact,
JAR_EXTENSION);
final String localRepositoryDirectory = this.localRepository.getBasedir();
final File existingFile = new File(localRepositoryDirectory, path);
final String bootstrapGroupId = this.getBootstrapGroupId(artifact);
final String bootstrapPath = bootstrapGroupId.replace(
'.',
'/') + '/' + artifact.getArtifactId();
final File bootstrapFile = new File(installDirectory, bootstrapPath + '.' + JAR_EXTENSION);
this.getLog().info("Installing bootstrap artifact: " + bootstrapFile);
FileUtils.copyFile(
existingFile,
bootstrapFile);
final File bootstrapPomFile = new File(installDirectory, bootstrapPath + '.' + POM_EXTENSION);
this.writeMinimalPom(bootstrapPomFile);
}
catch (final Throwable throwable)
{
throw new MojoExecutionException("Error creating bootstrap artifact", throwable);
}
}
}