mirror of https://github.com/apache/maven.git
Remove unused code that triggers Error Prone (#245)
Running Error Prone over Maven triggers an infinite recursion check in AbstractCoreMavenComponentTestCase.PluginBuilder
This commit is contained in:
parent
763f76cf83
commit
fdde73fcb4
|
@ -327,57 +327,4 @@ public abstract class AbstractCoreMavenComponentTestCase
|
|||
return project;
|
||||
}
|
||||
}
|
||||
|
||||
protected class PluginBuilder
|
||||
{
|
||||
private Plugin plugin;
|
||||
|
||||
public PluginBuilder( String groupId, String artifactId, String version )
|
||||
{
|
||||
plugin = new Plugin();
|
||||
plugin.setGroupId( groupId );
|
||||
plugin.setArtifactId( artifactId );
|
||||
plugin.setVersion( version );
|
||||
}
|
||||
|
||||
// Dependencies
|
||||
//
|
||||
public PluginBuilder addDependency( String groupId, String artifactId, String version, String scope, Exclusion exclusion )
|
||||
{
|
||||
return addDependency( groupId, artifactId, version, scope, exclusion );
|
||||
}
|
||||
|
||||
public PluginBuilder addDependency( String groupId, String artifactId, String version, String scope, String systemPath )
|
||||
{
|
||||
return addDependency( groupId, artifactId, version, scope, systemPath, null );
|
||||
}
|
||||
|
||||
public PluginBuilder addDependency( String groupId, String artifactId, String version, String scope, String systemPath, Exclusion exclusion )
|
||||
{
|
||||
Dependency d = new Dependency();
|
||||
d.setGroupId( groupId );
|
||||
d.setArtifactId( artifactId );
|
||||
d.setVersion( version );
|
||||
d.setScope( scope );
|
||||
|
||||
if ( systemPath != null && scope.equals( Artifact.SCOPE_SYSTEM ) )
|
||||
{
|
||||
d.setSystemPath( systemPath );
|
||||
}
|
||||
|
||||
if ( exclusion != null )
|
||||
{
|
||||
d.addExclusion( exclusion );
|
||||
}
|
||||
|
||||
plugin.getDependencies().add( d );
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Plugin get()
|
||||
{
|
||||
return plugin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,28 +214,6 @@ public class PluginManagerTest
|
|||
public void testThatPluginDependencyThatHasSystemScopeIsResolved()
|
||||
throws Exception
|
||||
{
|
||||
/*
|
||||
File systemPath = new File( getBasedir(), "pom.xml" );
|
||||
|
||||
Plugin plugin = new PluginBuilder( "org.apache.maven", "project-test", "1.0" )
|
||||
.addDependency( "org.apache.maven", "system-dependency", "1.0", Artifact.SCOPE_SYSTEM, systemPath.getAbsolutePath() )
|
||||
.get();
|
||||
|
||||
MavenProject pluginProject = new ProjectBuilder( "org.apache.maven", "project-test", "1.0" )
|
||||
.addPlugin( plugin )
|
||||
.addDependency( "junit", "junit", "3.8.1", Artifact.SCOPE_COMPILE )
|
||||
.get();
|
||||
|
||||
// i'm making this artifact which is assumed to come from a pom in the metadata processor, then it tries to create a POM artifact
|
||||
// and parse it for the dependencies and it blows up.
|
||||
//
|
||||
// we need to pass this through as is so it doesn't get parsed again.
|
||||
Artifact pluginArtifact = new ProjectArtifact( pluginProject );
|
||||
|
||||
Set<Artifact> artifacts = pluginManager.getPluginArtifacts( pluginArtifact, plugin, getLocalRepository(), getPluginArtifactRepositories() );
|
||||
System.out.println( artifacts );
|
||||
*/
|
||||
|
||||
MavenSession session = createMavenSession( getProject( "project-contributing-system-scope-plugin-dep" ) );
|
||||
MavenProject project = session.getCurrentProject();
|
||||
Plugin plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" );
|
||||
|
|
Loading…
Reference in New Issue