removed dead code
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1645470 13f79535-47bb-0310-9956-ffa450edef68master
parent
599b468d0d
commit
5c7faf1b8e
|
|
@ -24,7 +24,6 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
import org.apache.maven.doxia.sink.Sink;
|
import org.apache.maven.doxia.sink.Sink;
|
||||||
import org.apache.maven.doxia.siterenderer.Renderer;
|
import org.apache.maven.doxia.siterenderer.Renderer;
|
||||||
import org.apache.maven.model.Plugin;
|
import org.apache.maven.model.Plugin;
|
||||||
import org.apache.maven.model.ReportPlugin;
|
|
||||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||||
|
|
@ -55,7 +54,6 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
@ -221,7 +219,6 @@ public class PluginReport
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings( "unchecked" )
|
|
||||||
protected void executeReport( Locale locale )
|
protected void executeReport( Locale locale )
|
||||||
throws MavenReportException
|
throws MavenReportException
|
||||||
{
|
{
|
||||||
|
|
@ -274,6 +271,7 @@ public class PluginReport
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
|
List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
|
||||||
pluginDescriptor.setDependencies( deps );
|
pluginDescriptor.setDependencies( deps );
|
||||||
|
|
||||||
|
|
@ -684,6 +682,7 @@ public class PluginReport
|
||||||
return jdk;
|
return jdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
Plugin compiler = getCompilerPlugin( project.getBuild().getPluginsAsMap() );
|
Plugin compiler = getCompilerPlugin( project.getBuild().getPluginsAsMap() );
|
||||||
|
|
||||||
jdk = getTarget( compiler );
|
jdk = getTarget( compiler );
|
||||||
|
|
@ -692,6 +691,7 @@ public class PluginReport
|
||||||
return jdk;
|
return jdk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
Plugin compilerManagement = getCompilerPlugin( project.getPluginManagement().getPluginsAsMap() );
|
Plugin compilerManagement = getCompilerPlugin( project.getPluginManagement().getPluginsAsMap() );
|
||||||
|
|
||||||
jdk = getTarget( compilerManagement );
|
jdk = getTarget( compilerManagement );
|
||||||
|
|
@ -763,60 +763,5 @@ public class PluginReport
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param pluginsAsMap could be null
|
|
||||||
* @return the value of the <code>target</code> in the configuration of <code>maven-compiler-plugin</code>.
|
|
||||||
*/
|
|
||||||
private static String discoverJdkRequirementFromPlugins( Map<String, Object> pluginsAsMap, Properties props )
|
|
||||||
{
|
|
||||||
if ( pluginsAsMap == null )
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// default value
|
|
||||||
String jdk = props.getProperty( "maven.compiler.target" );
|
|
||||||
|
|
||||||
String backupJdk = null;
|
|
||||||
for ( Map.Entry<String, Object> entry : pluginsAsMap.entrySet() )
|
|
||||||
{
|
|
||||||
if ( !entry.getKey().equals( "org.apache.maven.plugins:maven-compiler-plugin" ) )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Object value = entry.getValue();
|
|
||||||
Xpp3Dom pluginConf = null;
|
|
||||||
|
|
||||||
backupJdk = "Default version for maven-compiler-plugin";
|
|
||||||
if ( value instanceof Plugin )
|
|
||||||
{
|
|
||||||
Plugin plugin = (Plugin) value;
|
|
||||||
backupJdk = "Default target for maven-compiler-plugin version " + plugin.getVersion();
|
|
||||||
pluginConf = (Xpp3Dom) plugin.getConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( value instanceof ReportPlugin )
|
|
||||||
{
|
|
||||||
ReportPlugin reportPlugin = (ReportPlugin) value;
|
|
||||||
backupJdk = "Default target for maven-compiler-plugin version " + reportPlugin.getVersion();
|
|
||||||
pluginConf = (Xpp3Dom) reportPlugin.getConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( pluginConf == null )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Xpp3Dom target = pluginConf.getChild( "target" );
|
|
||||||
if ( target != null )
|
|
||||||
{
|
|
||||||
jdk = target.getValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ( jdk == null ) ? backupJdk : jdk;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue