Search in sources :

Example 6 with MavenProducerInstaller

use of org.jboss.galleon.universe.maven.MavenProducerInstaller 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();
}
Also used : MavenProducerInstaller(org.jboss.galleon.universe.maven.MavenProducerInstaller) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Example 7 with MavenProducerInstaller

use of org.jboss.galleon.universe.maven.MavenProducerInstaller 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();
}
Also used : MavenProducerInstaller(org.jboss.galleon.universe.maven.MavenProducerInstaller) MavenUniverseInstaller(org.jboss.galleon.universe.maven.MavenUniverseInstaller) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Example 8 with MavenProducerInstaller

use of org.jboss.galleon.universe.maven.MavenProducerInstaller 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;
}
Also used : MavenProducerInstaller(org.jboss.galleon.universe.maven.MavenProducerInstaller) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Example 9 with MavenProducerInstaller

use of org.jboss.galleon.universe.maven.MavenProducerInstaller in project galleon by wildfly.

the class MvnUniverse method createProducer.

public MvnUniverse createProducer(String producerName, String fpArtifactId, int defaultChannel, int channels) throws ProvisioningException {
    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);
    producer.addFrequencies(frequencies);
    while (channels > 0) {
        producer.addChannel(Integer.toString(channels), new StringBuilder().append('[').append(channels).append(".0.0-alpha,").append(channels + 1).append(".0.0-alpha)").toString(), defaultChannel == channels);
        --channels;
    }
    producers = CollectionUtils.add(producers, producer.install());
    return this;
}
Also used : MavenProducerInstaller(org.jboss.galleon.universe.maven.MavenProducerInstaller) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Example 10 with MavenProducerInstaller

use of org.jboss.galleon.universe.maven.MavenProducerInstaller in project galleon by wildfly.

the class SimpleUniverseFactoryLoaderTestCase method doInit.

@Override
public void doInit() throws Exception {
    MavenArtifact artifact = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("producer-artifact1").setVersion("1.0.0.Final");
    MavenProducerInstaller producerInstaller = new MavenProducerInstaller("producer1", repo, artifact, FP_GROUP_ID, FP_ARTIFACT_ID);
    producerInstaller.addChannel("5", "[5.0,6.0)");
    producerInstaller.addFrequencies("alpha", "beta");
    producerInstaller.install();
    artifact = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId(UNIVERSE_ARTIFACT_ID).setVersion("1.0.0.Final");
    final MavenUniverseInstaller universeInstaller = new MavenUniverseInstaller(repo, artifact);
    universeInstaller.addProducer("producer1", GROUP_ID, "producer-artifact1", "[1.0.0,2.0.0)");
    universeInstaller.install();
}
Also used : MavenProducerInstaller(org.jboss.galleon.universe.maven.MavenProducerInstaller) MavenUniverseInstaller(org.jboss.galleon.universe.maven.MavenUniverseInstaller) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Aggregations

MavenProducerInstaller (org.jboss.galleon.universe.maven.MavenProducerInstaller)13 MavenArtifact (org.jboss.galleon.universe.maven.MavenArtifact)11 MavenUniverseInstaller (org.jboss.galleon.universe.maven.MavenUniverseInstaller)6 MavenChannel (org.jboss.galleon.universe.maven.MavenChannel)2 MavenProducer (org.jboss.galleon.universe.maven.MavenProducer)2 MavenUniverseException (org.jboss.galleon.universe.maven.MavenUniverseException)2 Test (org.junit.Test)2 HashSet (java.util.HashSet)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MavenArtifactRepositoryManager (org.jboss.galleon.maven.plugin.util.MavenArtifactRepositoryManager)1