Search in sources :

Example 1 with MavenProducers

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());
}
Also used : MavenProducers(org.jboss.galleon.universe.maven.MavenProducers) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MavenArtifactRepositoryManager(org.jboss.galleon.maven.plugin.util.MavenArtifactRepositoryManager) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact) MavenUniverseException(org.jboss.galleon.universe.maven.MavenUniverseException)

Aggregations

MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MavenArtifactRepositoryManager (org.jboss.galleon.maven.plugin.util.MavenArtifactRepositoryManager)1 MavenArtifact (org.jboss.galleon.universe.maven.MavenArtifact)1 MavenProducers (org.jboss.galleon.universe.maven.MavenProducers)1 MavenUniverseException (org.jboss.galleon.universe.maven.MavenUniverseException)1