use of org.jboss.galleon.universe.maven.MavenProducerInstaller in project galleon by wildfly.
the class MavenUniverseFeaturePackCreatorTestCase method doInit.
@Override
protected void doInit() throws Exception {
final MavenProducerInstaller producer1 = new MavenProducerInstaller("producer1", repo, new MavenArtifact().setGroupId("universe.producer.maven.test").setArtifactId("maven-producer1").setVersion("1.0.0.Final"), "universe.feature-pack.maven.test", "feature-pack1").addFrequencies("alpha", "beta").addChannel("1.0", "[1.0.0,2.0.0)").install();
new MavenUniverseInstaller(repo, new MavenArtifact().setGroupId("universe.maven.test").setArtifactId("maven-universe1").setVersion("1.0.0.Final")).addProducer(producer1.getName(), producer1.getArtifact().setPath(null).setVersionRange("[1.0,2.0-alpha)")).install();
FeaturePackCreator.getInstance().addArtifactResolver(repo).newFeaturePack().setFPID(FeaturePackLocation.fromString("producer1@" + MavenUniverseFactory.ID + "(universe.maven.test:maven-universe1:[1.0,2.0-alpha)):1.0#1.0.0.Final").getFPID()).newPackage("p1", true).writeContent("p1.txt", "p1 text").getFeaturePack().getCreator().install();
}
use of org.jboss.galleon.universe.maven.MavenProducerInstaller in project galleon by wildfly.
the class CreateProducerMojo method createProducer.
private void createProducer() throws MavenUniverseException, MojoExecutionException {
final MavenArtifact producerArtifact = new MavenArtifact().setGroupId(groupId).setArtifactId(artifactId).setVersion(version);
final MavenProducerInstaller installer = new MavenProducerInstaller(name, SimplisticMavenRepoManager.getInstance(Paths.get(project.getBuild().getDirectory()).resolve("local-repo"), new MavenArtifactRepositoryManager(repoSystem, repoSession, repositories)), producerArtifact, featurePackGroupId, featurePackArtifactId);
for (String frequency : frequencies) {
installer.addFrequency(frequency);
}
final Set<String> names = new HashSet<>(channels.size());
for (ChannelDescription channel : channels) {
if (!names.add(channel.name)) {
throw new MojoExecutionException("Duplicate channel " + channel.name);
}
try {
installer.addChannel(channel.name, channel.versionRange);
} catch (MavenUniverseException e) {
throw new MojoExecutionException("Failed to add channel " + channel.name, e);
}
}
try {
installer.install();
} catch (MavenUniverseException e) {
throw new MojoExecutionException("Failed to create producer", e);
}
projectHelper.attachArtifact(project, "jar", producerArtifact.getPath().toFile());
}
use of org.jboss.galleon.universe.maven.MavenProducerInstaller in project galleon by wildfly.
the class MavenUniverseInstallTestCase method doInit.
@Override
protected void doInit() throws Exception {
universeArtifact = new MavenArtifact();
universeArtifact.setGroupId(GROUP_ID);
universeArtifact.setArtifactId("test-universe");
universeArtifact.setVersion("1.0.0.Final");
MavenArtifact artifact = new MavenArtifact();
artifact.setGroupId(GROUP_ID);
artifact.setArtifactId("producer1");
artifact.setVersion("1.0.0.Final");
MavenProducerInstaller producerInstaller = new MavenProducerInstaller("producer1", repo, artifact);
producerInstaller.addFrequencies("alpha", "beta");
producerInstaller.install();
artifact = new MavenArtifact();
artifact.setGroupId(GROUP_ID);
artifact.setArtifactId("producer2");
artifact.setVersion("3.0.0.Final");
producerInstaller = new MavenProducerInstaller("producer2", repo, artifact);
producerInstaller.addFrequencies("alpha", "beta");
producerInstaller.install();
}
Aggregations