Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code that triggers Error Prone. #245

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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