Search in sources :

Example 6 with MavenArtifact

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

Example 7 with MavenArtifact

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

Example 8 with MavenArtifact

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

Example 9 with MavenArtifact

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

Example 10 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, 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)

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