use of org.jboss.galleon.universe.maven.MavenProducers in project galleon by wildfly.
the class CreateProducersMojo method execute.
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
getLog().info("Skipping the create-producers goal.");
return;
}
final MavenArtifact artifact = new MavenArtifact().setGroupId(groupId).setArtifactId(artifactId).setVersion(version);
final MavenProducers installer = MavenProducers.getInstance(SimplisticMavenRepoManager.getInstance(Paths.get(project.getBuild().getDirectory()).resolve("local-repo"), new MavenArtifactRepositoryManager(repoSystem, repoSession, repositories)), artifact);
for (ProducerDescription producer : producers) {
installer.addProducer(producer);
}
try {
installer.install();
} catch (MavenUniverseException e) {
throw new MojoExecutionException("Failed to create producers artifact", e);
}
projectHelper.attachArtifact(project, "jar", artifact.getPath().toFile());
}
Aggregations