Search in sources :

Example 31 with MavenArtifact

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

the class MavenUniverseLocationTestCase method testUniverseVersion.

@Test
public void testUniverseVersion() throws Exception {
    final MavenArtifact universeArt = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact").setVersion("1.0.0.Final");
    Path path = resolver.resolve(FeaturePackLocation.fromString("producer1@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
    Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
    try {
        universeArt.setPath(null);
        resolver.resolve(FeaturePackLocation.fromString("producer2@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
        Assert.fail("producer2 is not in this universe version");
    } catch (MavenUniverseException e) {
        Assert.assertEquals(MavenErrors.producerNotFound("producer2").getLocalizedMessage(), e.getLocalizedMessage());
    }
    universeArt.setPath(null);
    universeArt.setVersion("1.0.1.Final");
    path = resolver.resolve(FeaturePackLocation.fromString("producer2@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
    Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
}
Also used : Path(java.nio.file.Path) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact) MavenUniverseException(org.jboss.galleon.universe.maven.MavenUniverseException) Test(org.junit.Test)

Example 32 with MavenArtifact

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

the class MavenUniverseLocationTestCase method testUniverseWithoutVersion.

@Test
public void testUniverseWithoutVersion() throws Exception {
    final MavenArtifact universeArt = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact");
    Path path = resolver.resolve(FeaturePackLocation.fromString("producer1@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
    Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
    universeArt.setPath(null);
    path = resolver.resolve(FeaturePackLocation.fromString("producer2@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
    Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
}
Also used : Path(java.nio.file.Path) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact) Test(org.junit.Test)

Example 33 with MavenArtifact

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

the class MavenUniverseLocationTestCase method testUniverseVersionRange.

@Test
public void testUniverseVersionRange() throws Exception {
    final MavenArtifact universeArt = new MavenArtifact().setGroupId(GROUP_ID).setArtifactId("universe1-artifact").setVersionRange("[1.0,2.0-alpha)");
    Path path = resolver.resolve(FeaturePackLocation.fromString("producer1@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
    Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
    universeArt.setPath(null);
    path = resolver.resolve(FeaturePackLocation.fromString("producer2@" + MavenUniverseFactory.ID + '(' + universeArt.getCoordsAsString() + "):5/alpha"));
    Assert.assertEquals(fpArt.getArtifactFileName(), path.getFileName().toString());
}
Also used : Path(java.nio.file.Path) MavenArtifact(org.jboss.galleon.universe.maven.MavenArtifact) Test(org.junit.Test)

Example 34 with MavenArtifact

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

the class MavenProducerExtendAndInstallTestCase method doInit.

@Override
protected void doInit() {
    producer100Artifact = new MavenArtifact();
    producer100Artifact.setGroupId(GROUP_ID);
    producer100Artifact.setArtifactId("test-producer");
    producer100Artifact.setVersion("1.0.0.Final");
    producer101Artifact = new MavenArtifact();
    producer101Artifact.setGroupId(producer100Artifact.getGroupId());
    producer101Artifact.setArtifactId(producer100Artifact.getArtifactId());
    producer101Artifact.setVersion("1.0.1.Final");
}
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