Description: Adjust the source/release level automatically for building with recent JDKs
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -158,6 +158,8 @@
 public abstract class AbstractJavadocMojo
     extends AbstractMojo
 {
+    private List<String> unsupportedLanguageLevels = java.util.Arrays.asList(new String[]{"1.1", "1.2", "1.3", "1.4", "1.5", "5", "1.6", "6"});
+
     /**
      * Classifier used in the name of the javadoc-options XML file, and in the resources bundle
      * artifact that gets attached to the project. This one is used for non-test javadocs.
@@ -2028,6 +2030,19 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+	String defaultLevel = "7";
+        if ( unsupportedLanguageLevels.contains( release ) )
+        {
+            System.err.println( "Use of release " + release + " is no longer supported, switching to " + defaultLevel );
+            release = defaultLevel;
+        }
+
+        if ( unsupportedLanguageLevels.contains( source ) )
+        {
+            System.err.println( "Use of source " + source + " is no longer supported, switching to " + defaultLevel );
+            source = defaultLevel;
+        }
+
         verifyRemovedParameter( "aggregator" );
         verifyRemovedParameter( "proxyHost" );
         verifyRemovedParameter( "proxyPort" );
