mirror of https://github.com/apache/maven.git
o looking other IDE integration and cleaning up stub methods that are useless to anyone until they are implemented fully and properly
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@491536 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ae10e790ac
commit
318ec6ac0f
|
@ -276,45 +276,6 @@ public class MavenEmbedder
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Plugins
|
// Plugins
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
public List getAvailablePlugins()
|
|
||||||
{
|
|
||||||
List plugins = new ArrayList();
|
|
||||||
|
|
||||||
plugins.add( makeMockPlugin( "org.apache.maven.plugins", "maven-jar-plugin", "Maven Jar Plug-in" ) );
|
|
||||||
|
|
||||||
plugins.add( makeMockPlugin( "org.apache.maven.plugins", "maven-compiler-plugin", "Maven Compiler Plug-in" ) );
|
|
||||||
|
|
||||||
return plugins;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PluginDescriptor getPluginDescriptor( SummaryPluginDescriptor summaryPluginDescriptor )
|
|
||||||
throws MavenEmbedderException
|
|
||||||
{
|
|
||||||
PluginDescriptor pluginDescriptor;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
InputStream is =
|
|
||||||
realm.getResourceAsStream( "/plugins/" + summaryPluginDescriptor.getArtifactId() + ".xml" );
|
|
||||||
|
|
||||||
pluginDescriptor = pluginDescriptorBuilder.build( new InputStreamReader( is ) );
|
|
||||||
}
|
|
||||||
catch ( PlexusConfigurationException e )
|
|
||||||
{
|
|
||||||
throw new MavenEmbedderException( "Error retrieving plugin descriptor.", e );
|
|
||||||
}
|
|
||||||
|
|
||||||
return pluginDescriptor;
|
|
||||||
}
|
|
||||||
|
|
||||||
private SummaryPluginDescriptor makeMockPlugin( String groupId,
|
|
||||||
String artifactId,
|
|
||||||
String name )
|
|
||||||
{
|
|
||||||
return new SummaryPluginDescriptor( groupId, artifactId, name );
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Execution of phases/goals
|
// Execution of phases/goals
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -352,7 +313,6 @@ public class MavenEmbedder
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Remote Repository
|
// Remote Repository
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Local Repository
|
// Local Repository
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
@ -143,27 +143,6 @@ public class MavenEmbedderTest
|
||||||
assertEquals( "somnambulance", p1.getProperties().getProperty( "occupation" ) );
|
assertEquals( "somnambulance", p1.getProperties().getProperty( "occupation" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
// Test mock plugin metadata
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
public void xtestMockPluginMetadata()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
List plugins = maven.getAvailablePlugins();
|
|
||||||
|
|
||||||
SummaryPluginDescriptor spd = (SummaryPluginDescriptor) plugins.get( 0 );
|
|
||||||
|
|
||||||
assertNotNull( spd );
|
|
||||||
|
|
||||||
PluginDescriptor pd = maven.getPluginDescriptor( spd );
|
|
||||||
|
|
||||||
assertNotNull( pd );
|
|
||||||
|
|
||||||
assertEquals( "org.apache.maven.plugins", pd.getGroupId() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Lifecycle phases
|
// Lifecycle phases
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -209,15 +188,19 @@ public class MavenEmbedderTest
|
||||||
protected void projectReadingTest()
|
protected void projectReadingTest()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
MavenProject project = maven.readProjectWithDependencies( getPomFile() );
|
MavenExecutionRequest request = new DefaultMavenExecutionRequest().setPomFile( getPomFile().getAbsolutePath() );
|
||||||
|
|
||||||
assertEquals( "org.apache.maven", project.getGroupId() );
|
MavenExecutionResult result = maven.readProjectWithDependencies( request );
|
||||||
|
|
||||||
Set artifacts = project.getArtifacts();
|
assertEquals( "org.apache.maven", result.getMavenProject().getGroupId() );
|
||||||
|
|
||||||
|
Set artifacts = result.getMavenProject().getArtifacts();
|
||||||
|
|
||||||
assertEquals( 1, artifacts.size() );
|
assertEquals( 1, artifacts.size() );
|
||||||
|
|
||||||
Artifact artifact = (Artifact) artifacts.iterator().next();
|
Artifact artifact = (Artifact) artifacts.iterator().next();
|
||||||
|
|
||||||
|
System.out.println( "artifact = " + artifact );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -228,8 +211,4 @@ public class MavenEmbedderTest
|
||||||
{
|
{
|
||||||
return new File( basedir, "src/test/resources/pom.xml" );
|
return new File( basedir, "src/test/resources/pom.xml" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNothing()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue