Search in sources :

Example 11 with MavenArtifact

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, 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 12 with MavenArtifact

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

the class MvnUniverse method install.

public MavenArtifact install() throws ProvisioningException {
    final MavenArtifact universeArtifact = new MavenArtifact().setGroupId(TestConstants.GROUP_ID).setArtifactId(name).setVersion("1.0.0.Final");
    final MavenUniverseInstaller installer = new MavenUniverseInstaller(repoManager, universeArtifact);
    for (MavenProducerBase p : producers) {
        installer.addProducer(p.getName(), p.getArtifact().setPath(null).setVersionRange("[1.0,)"));
    }
    installer.install();
    return universeArtifact;
}
Also used : MavenProducerBase(org.jboss.galleon.universe.maven.MavenProducerBase) MavenUniverseInstaller(org.jboss.galleon.universe.maven.MavenUniverseInstaller) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Example 13 with MavenArtifact

use of org.jboss.galleon.universe.maven.MavenArtifact 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)

Example 14 with MavenArtifact

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

the class BasicPluginLocationTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    final MavenArtifact pluginArtifact = new MavenArtifact().setGroupId("org.jboss.galleon.plugin.test").setArtifactId("test-plugin").setVersion("1");
    installPluginArtifact(pluginArtifact, TestPlugin.class);
    fp1 = newFpl("prod1", "1", "1.0.0.Final");
    creator.newFeaturePack(fp1.getFPID()).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1 p1").getFeaturePack().addPlugin("test-plugin", pluginArtifact.getCoordsAsString());
}
Also used : MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Example 15 with MavenArtifact

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

the class PatchedDependencyPluginDoesNotOverrideMainPluginTestCase method createFeaturePacks.

@Override
protected void createFeaturePacks(FeaturePackCreator creator) throws ProvisioningException {
    final MavenArtifact fp1Plugin = installPluginArtifact(new MavenArtifact().setGroupId("org.jboss.galleon.plugin.test").setArtifactId("fp1-plugin").setVersion("1"), Fp1Plugin1.class);
    final MavenArtifact plugin1 = installPluginArtifact(new MavenArtifact().setGroupId("org.jboss.galleon.plugin.test").setArtifactId("test-plugin").setVersion("1"), TestPlugin1.class);
    final MavenArtifact plugin2 = installPluginArtifact(new MavenArtifact().setGroupId("org.jboss.galleon.plugin.test").setArtifactId("test-plugin").setVersion("2"), TestPlugin2.class);
    fp1 = newFpl("prod1", "1", "1.0.0.Final");
    creator.newFeaturePack(fp1.getFPID()).addPlugin("test-plugin", plugin1.getCoordsAsString()).addPlugin("fp1-plugin", fp1Plugin.getCoordsAsString());
    fp1Patch1 = newFpl("prod1", "1", "1.0.0.Patch1.Final");
    creator.newFeaturePack(fp1Patch1.getFPID()).setPatchFor(fp1.getFPID()).addPlugin("test-plugin", plugin2.getCoordsAsString());
    fp2 = newFpl("prod2", "1", "1.0.0.Final");
    creator.newFeaturePack(fp2.getFPID()).addDependency(fp1).addPlugin("test-plugin", plugin1.getCoordsAsString());
}
Also used : MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact)

Aggregations

MavenArtifact (org.jboss.galleon.universe.maven.MavenArtifact)34 MavenProducerInstaller (org.jboss.galleon.universe.maven.MavenProducerInstaller)11 MavenUniverseInstaller (org.jboss.galleon.universe.maven.MavenUniverseInstaller)8 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)6 MavenUniverseException (org.jboss.galleon.universe.maven.MavenUniverseException)6 Path (java.nio.file.Path)5 Test (org.junit.Test)5 MavenArtifactRepositoryManager (org.jboss.galleon.maven.plugin.util.MavenArtifactRepositoryManager)3 HashSet (java.util.HashSet)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 ProvisioningException (org.jboss.galleon.ProvisioningException)2 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Artifact (org.apache.maven.artifact.Artifact)1 Dependency (org.apache.maven.model.Dependency)1 Model (org.apache.maven.model.Model)1 Parent (org.apache.maven.model.Parent)1 PluginDescriptor (org.apache.maven.plugin.descriptor.PluginDescriptor)1