Search in sources :

Example 6 with PluginInfo

use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.

the class DescribeMojoTest method testParsePluginInfoGAV.

public void testParsePluginInfoGAV() throws Throwable {
    DescribeMojo mojo = new DescribeMojo();
    PrivateAccessor.setField(mojo, "groupId", "org.test");
    PrivateAccessor.setField(mojo, "artifactId", "test");
    PrivateAccessor.setField(mojo, "version", "1.0");
    PluginInfo pi = (PluginInfo) PrivateAccessor.invoke(mojo, "parsePluginLookupInfo", null, null);
    assertEquals(pi.getGroupId(), "org.test");
    assertEquals(pi.getArtifactId(), "test");
    assertEquals(pi.getVersion(), "1.0");
    assertNull(pi.getPrefix());
}
Also used : PluginInfo(org.apache.maven.plugins.help.DescribeMojo.PluginInfo)

Example 7 with PluginInfo

use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.

the class DescribeMojoTest method testParsePluginInfoPluginGA.

public void testParsePluginInfoPluginGA() throws Throwable {
    DescribeMojo mojo = new DescribeMojo();
    PrivateAccessor.setField(mojo, "plugin", "org.test:test");
    PluginInfo pi = (PluginInfo) PrivateAccessor.invoke(mojo, "parsePluginLookupInfo", null, null);
    assertEquals("org.test", pi.getGroupId());
    assertEquals("test", pi.getArtifactId());
    assertNull(pi.getVersion());
    assertNull(pi.getPrefix());
}
Also used : PluginInfo(org.apache.maven.plugins.help.DescribeMojo.PluginInfo)

Example 8 with PluginInfo

use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.

the class DescribeMojoTest method testLookupPluginDescriptorGMissingA.

public void testLookupPluginDescriptorGMissingA() throws Throwable {
    DescribeMojo mojo = new DescribeMojo();
    PluginInfo pi = new PluginInfo();
    pi.setGroupId("org.test");
    try {
        PrivateAccessor.invoke(mojo, "lookupPluginDescriptor", new Class[] { PluginInfo.class }, new Object[] { pi });
        fail();
    } catch (Exception e) {
        assertTrue(e.getMessage().startsWith("You must specify either"));
    }
}
Also used : PluginInfo(org.apache.maven.plugins.help.DescribeMojo.PluginInfo)

Example 9 with PluginInfo

use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.

the class DescribeMojoTest method testParsePluginInfoPluginGAV.

public void testParsePluginInfoPluginGAV() throws Throwable {
    DescribeMojo mojo = new DescribeMojo();
    PrivateAccessor.setField(mojo, "plugin", "org.test:test:1.0");
    PluginInfo pi = (PluginInfo) PrivateAccessor.invoke(mojo, "parsePluginLookupInfo", null, null);
    assertEquals("org.test", pi.getGroupId());
    assertEquals("test", pi.getArtifactId());
    assertEquals("1.0", pi.getVersion());
    assertNull(pi.getPrefix());
}
Also used : PluginInfo(org.apache.maven.plugins.help.DescribeMojo.PluginInfo)

Aggregations

PluginInfo (org.apache.maven.plugins.help.DescribeMojo.PluginInfo)9 MavenSession (org.apache.maven.execution.MavenSession)3 MojoDescriptorCreator (org.apache.maven.lifecycle.internal.MojoDescriptorCreator)3 Plugin (org.apache.maven.model.Plugin)3 PluginDescriptor (org.apache.maven.plugin.descriptor.PluginDescriptor)3 PluginVersionRequest (org.apache.maven.plugin.version.PluginVersionRequest)3 PluginVersionResolver (org.apache.maven.plugin.version.PluginVersionResolver)3 MavenPluginManagerHelper (org.apache.maven.reporting.exec.MavenPluginManagerHelper)3 PluginVersionResult (org.apache.maven.plugin.version.PluginVersionResult)1 MavenProject (org.apache.maven.project.MavenProject)1