use of org.jboss.galleon.universe.maven.MavenArtifact in project galleon by wildfly.
the class ProducerRefreshOnNotFoundChannelTestCase method setupUniverse.
private void setupUniverse(SimplisticMavenRepoManager repo, String producer, int... channels) throws MavenUniverseException {
final MavenUniverseInstaller universeInstaller = new MavenUniverseInstaller(repo, new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact").setVersion("1"));
final MavenArtifact producerArtifact = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId(producer).setVersion("1");
final String producerFpArtifactId = producer + "-fp";
MavenProducerInstaller producerInstaller = new MavenProducerInstaller(producer, repo, producerArtifact, GROUP_ID, producerFpArtifactId);
for (int channel : channels) {
producerInstaller.addChannel(Integer.toString(channel), "[" + channel + ".0-alpha," + (channel + 1) + ".0-alpha)");
}
producerInstaller.addFrequencies("alpha", "beta");
producerInstaller.install();
universeInstaller.addProducer(producer, GROUP_ID, producer, "[0,)");
universeInstaller.install();
}
use of org.jboss.galleon.universe.maven.MavenArtifact in project galleon by wildfly.
the class UniverseRefreshOnNotFoundProducerTestCase method setupUniverse.
private void setupUniverse(SimplisticMavenRepoManager repo, String... producers) throws MavenUniverseException {
final MavenUniverseInstaller universeInstaller = new MavenUniverseInstaller(repo, new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact").setVersion("1"));
for (String producer : producers) {
final MavenArtifact producerArtifact = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId(producer).setVersion("1");
final String producerFpArtifactId = producer + "-fp";
MavenProducerInstaller producerInstaller = new MavenProducerInstaller(producer, repo, producerArtifact, GROUP_ID, producerFpArtifactId);
producerInstaller.addChannel("1", "[1.0-alpha,2.0-alpha)");
producerInstaller.addFrequencies("alpha", "beta");
producerInstaller.install();
universeInstaller.addProducer(producer, GROUP_ID, producer, "[0,)");
}
universeInstaller.install();
}
use of org.jboss.galleon.universe.maven.MavenArtifact in project galleon by wildfly.
the class MavenUniverseExtendAndInstallTestCase method doInit.
@Override
protected void doInit() throws Exception {
universe100Artifact = new MavenArtifact();
universe100Artifact.setGroupId(GROUP_ID);
universe100Artifact.setArtifactId("test-universe");
universe100Artifact.setVersion("1.0.0.Final");
universe101Artifact = new MavenArtifact();
universe101Artifact.setGroupId(universe100Artifact.getGroupId());
universe101Artifact.setArtifactId(universe100Artifact.getArtifactId());
universe101Artifact.setVersion("1.0.1.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();
artifact = new MavenArtifact();
artifact.setGroupId(GROUP_ID);
artifact.setArtifactId("producer3");
artifact.setVersion("2.5.1.Final");
producerInstaller = new MavenProducerInstaller("producer3", repo, artifact);
producerInstaller.addFrequencies("alpha", "beta");
producerInstaller.install();
}
use of org.jboss.galleon.universe.maven.MavenArtifact in project galleon by wildfly.
the class MavenUniverseLocationTestCase method doInit.
@Override
public void doInit() throws Exception {
MavenArtifact artifact = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId(PRODUCER1_ARTIFACT_ID).setVersion("1.0.0.Final");
MavenProducerInstaller producerInstaller = new MavenProducerInstaller("producer1", repo, artifact, FP_GROUP_ID, PRODUCER1_FP_ARTIFACT_ID);
producerInstaller.addChannel("5", "[5.0-alpha,6.0-alpha)");
producerInstaller.addFrequencies("alpha", "beta");
producerInstaller.install();
artifact = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId(PRODUCER2_ARTIFACT_ID).setVersion("1.0.0.Final");
producerInstaller = new MavenProducerInstaller("producer2", repo, artifact, FP_GROUP_ID, PRODUCER1_FP_ARTIFACT_ID);
producerInstaller.addChannel("5", "[5.0-alpha,6.0-alpha)");
producerInstaller.addFrequencies("alpha", "beta");
producerInstaller.install();
MavenArtifact universeArt = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact").setVersion("1.0.0.Final");
MavenUniverseInstaller universeInstaller = new MavenUniverseInstaller(repo, universeArt);
universeInstaller.addProducer("producer1", GROUP_ID, PRODUCER1_ARTIFACT_ID, "[1.0.0,2.0.0)");
universeInstaller.install();
universeArt = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact").setVersion("1.0.1.Final");
universeInstaller = new MavenUniverseInstaller(repo, universeArt);
universeInstaller.addProducer("producer1", GROUP_ID, PRODUCER1_ARTIFACT_ID, "[1.0.0,2.0.0)");
universeInstaller.addProducer("producer2", GROUP_ID, "producer2-artifact", "[1.0.0,2.0.0)");
universeInstaller.install();
resolver = UniverseResolver.builder().addArtifactResolver(repo).build();
fpArt = new MavenArtifact().setGroupId(FP_GROUP_ID).setArtifactId(PRODUCER1_FP_ARTIFACT_ID).setExtension("zip").setVersion("5.1.0.Alpha1");
FeaturePackCreator.getInstance().addArtifactResolver(repo).newFeaturePack(FeaturePackLocation.fromString("producer1@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5#5.1.0.Alpha1").getFPID()).getCreator().install();
}
use of org.jboss.galleon.universe.maven.MavenArtifact in project galleon by wildfly.
the class MvnUniverse method createProducer.
public MvnUniverse createProducer(String producerName, String fpArtifactId, String defaultFrequency, String includeVersionRegex, String excludeVersionRegex) throws ProvisioningException {
final MavenProducerInstaller producer = new MavenProducerInstaller(producerName, repoManager, new MavenArtifact().setGroupId(TestConstants.GROUP_ID + '.' + name).setArtifactId(producerName).setVersion("1.0.0.Final"), TestConstants.GROUP_ID + '.' + name + '.' + producerName, fpArtifactId).addFrequencies(frequencies).addChannel("1", "[1.0.0-alpha,2.0.0-alpha)", false, includeVersionRegex, excludeVersionRegex);
if (defaultFrequency != null) {
producer.addFrequency(defaultFrequency, true);
}
producers = CollectionUtils.add(producers, producer.install());
return this;
}
Aggregations