Skip to content

Commit

Permalink
Remove unused code that triggers Error Prone (#245)
Browse files Browse the repository at this point in the history
Running Error Prone over Maven triggers an infinite recursion
check in AbstractCoreMavenComponentTestCase.PluginBuilder; on
inspection, the class is unused. Remove it, along with the commented-
out (since bc257a5) reference to it.
  • Loading branch information
josephw authored and slachiewicz committed Apr 20, 2019
1 parent 0940c7c commit d5d222e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,57 +327,4 @@ public MavenProject get()
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -214,28 +214,6 @@ public void testMojoThatRequiresExecutionToAGivenPhaseBeforeExecutingItself()
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" );
Expand Down

0 comments on commit d5d222e

Please sign in to comment.