diff --git a/.travis.yml b/.travis.yml index 6158009b7e05c74711ba499c85fd48ca45d006e7..77bc3c835762e1e112804a42a7462628db95863a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: java jdk: - - oraclejdk8 - - oraclejdk9 - - openjdk7 - + - openjdk8 + - openjdk9 + - openjdk11 + script: "mvn --show-version --errors --batch-mode clean verify -DredirectTestOutputToFile=false" cache: diff --git a/plexus-compiler-api/pom.xml b/plexus-compiler-api/pom.xml index a93dbf71ae3cd1fa03fee412cfef046c6f67caf1..b8ecb536e1b37a7d4b74ba4e61950ae846e58298 100644 --- a/plexus-compiler-api/pom.xml +++ b/plexus-compiler-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compiler</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-api</artifactId> diff --git a/plexus-compiler-manager/pom.xml b/plexus-compiler-manager/pom.xml index af279c7675acae3a546dcb1a070d86c86045423c..5343d520d1baa6a1ef479bc4c273ad26f9058548 100644 --- a/plexus-compiler-manager/pom.xml +++ b/plexus-compiler-manager/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compiler</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-manager</artifactId> diff --git a/plexus-compiler-test/pom.xml b/plexus-compiler-test/pom.xml index c3d6e37ea53d149b2769cd5c8186e3410237efa4..b326c251e681a0db4cf3c2dda82386d3d29033db 100644 --- a/plexus-compiler-test/pom.xml +++ b/plexus-compiler-test/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compiler</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-test</artifactId> diff --git a/plexus-compiler-test/src/main/java/org/codehaus/plexus/compiler/AbstractCompilerTest.java b/plexus-compiler-test/src/main/java/org/codehaus/plexus/compiler/AbstractCompilerTest.java index 9c1c9d42d95add904f0ebc7602050ccc3aceb27e..50da0b4b1ff250c542cdf690e26457e4173870f0 100644 --- a/plexus-compiler-test/src/main/java/org/codehaus/plexus/compiler/AbstractCompilerTest.java +++ b/plexus-compiler-test/src/main/java/org/codehaus/plexus/compiler/AbstractCompilerTest.java @@ -115,9 +115,12 @@ public abstract class AbstractCompilerTest int numCompilerWarnings = messages.size() - numCompilerErrors; - if ( expectedErrors() != numCompilerErrors ) + int expectedErrors = expectedErrors(); + + if ( expectedErrors != numCompilerErrors ) { System.out.println( numCompilerErrors + " error(s) found:" ); + List<String> errors = new ArrayList<>(); for ( CompilerMessage error : messages ) { if ( !error.isError() ) @@ -129,13 +132,17 @@ public abstract class AbstractCompilerTest System.out.println( error.getFile() ); System.out.println( error.getMessage() ); System.out.println( "----" ); + errors.add( error.getMessage() ); } - assertEquals( "Wrong number of compilation errors: " + messages, expectedErrors(), numCompilerErrors ); + assertEquals( "Wrong number of compilation errors (" + numCompilerErrors + "/" + expectedErrors // + + ") : " + errors, expectedErrors, numCompilerErrors ); } - if ( expectedWarnings() != numCompilerWarnings ) + int expectedWarnings = expectedWarnings(); + if ( expectedWarnings != numCompilerWarnings ) { + List<String> warnings = new ArrayList<>(); System.out.println( numCompilerWarnings + " warning(s) found:" ); for ( CompilerMessage error : messages ) { @@ -148,9 +155,11 @@ public abstract class AbstractCompilerTest System.out.println( error.getFile() ); System.out.println( error.getMessage() ); System.out.println( "----" ); + warnings.add( error.getMessage() ); } - assertEquals( "Wrong number of compilation warnings.", expectedWarnings(), numCompilerWarnings ); + assertEquals( "Wrong number (" + numCompilerWarnings + "/" + expectedWarnings + ") of compilation warnings: " + warnings, // + expectedWarnings, numCompilerWarnings ); } assertEquals( new TreeSet<>( normalizePaths( expectedOutputFiles() ) ), files ); @@ -224,7 +233,7 @@ public abstract class AbstractCompilerTest private List<String> normalizePaths( Collection<String> relativePaths ) { - List<String> normalizedPaths = new ArrayList<String>(); + List<String> normalizedPaths = new ArrayList<>(); for ( String relativePath : relativePaths ) { normalizedPaths.add( relativePath.replace( File.separatorChar, '/' ) ); diff --git a/plexus-compilers/plexus-compiler-aspectj/pom.xml b/plexus-compilers/plexus-compiler-aspectj/pom.xml index 73ff7e4ee03146c06abe317d74317d733ad55e86..1a04cb29f61037cc6ebd440f697746130f61a581 100644 --- a/plexus-compilers/plexus-compiler-aspectj/pom.xml +++ b/plexus-compilers/plexus-compiler-aspectj/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compilers</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-aspectj</artifactId> @@ -14,7 +14,7 @@ <description>AspectJ Compiler support for Plexus Compiler component.</description> <properties> - <aspectj.version>1.8.9</aspectj.version> + <aspectj.version>1.9.2</aspectj.version> </properties> <dependencies> diff --git a/plexus-compilers/plexus-compiler-aspectj/src/main/java/org/codehaus/plexus/compiler/ajc/AspectJCompiler.java b/plexus-compilers/plexus-compiler-aspectj/src/main/java/org/codehaus/plexus/compiler/ajc/AspectJCompiler.java index 0371967adecf3bbdf6282bce6a50d8d0f6b447a2..29e9b2f87eeb613ab5acb1f5b8a516904966a196 100644 --- a/plexus-compilers/plexus-compiler-aspectj/src/main/java/org/codehaus/plexus/compiler/ajc/AspectJCompiler.java +++ b/plexus-compilers/plexus-compiler-aspectj/src/main/java/org/codehaus/plexus/compiler/ajc/AspectJCompiler.java @@ -28,117 +28,159 @@ import java.util.List; import java.util.Map; /** - * <p/> + * <p> * Options - * <p/> + * </p> + * <p> * -injars JarList - * <p/> + * </p> + * <p> * Accept as source bytecode any .class files inside the specified .jar files. The output will include these * classes, possibly as woven with any applicable aspects. JarList, like classpath, is a single argument * containing a list of paths to jar files, delimited by the platform- specific classpath delimiter. - * <p/> + * </p> + * <p> * -aspectpath JarList - * <p/> + * </p> + * <p> * Weave binary aspects from JarList zip files into all sources. The aspects should have been output by * the same version of the compiler. To run the output classes requires putting all the aspectpath entries on * the run classpath. JarList, like classpath, is a single argument containing a list of paths to jar files, * delimited by the platform- specific classpath delimiter. - * <p/> + * </p> + * <p> * -argfile File - * <p/> + * </p> + * <p> * The file is a line-delimited list of arguments. These arguments are inserted into the argument list. - * <p/> + * </p> + * <p> * -outjar output.jar - * <p/> + * </p> + * <p> * Put output classes in zip file output.jar. - * <p/> + * </p> + * <p> * -incremental - * <p/> + * </p> + * <p> * Run the compiler continuously. After the initial compilation, the compiler will wait to recompile until it * reads a newline from the standard input, and will quit when it reads a 'q'. It will only recompile necessary * components, so a recompile should be much faster than doing a second compile. This requires -sourceroots. - * <p/> + * </p> + * <p> * -sourceroots DirPaths - * <p/> + * </p> + * <p> * Find and build all .java or .aj source files under any directory listed in DirPaths. DirPaths, like * classpath, is a single argument containing a list of paths to directories, delimited by the platform- * specific classpath delimiter. Required by -incremental. - * <p/> + * </p> + * <p> * -emacssym - * <p/> + * </p> + * <p> * Generate .ajesym symbol files for emacs support - * <p/> + * </p> + * <p> * -Xlint - * <p/> + * </p> + * <p> * Same as -Xlint:warning (enabled by default) - * <p/> + * </p> + * <p> * -Xlint:{level} - * <p/> + * </p> + * <p> * Set default level for messages about potential programming mistakes in crosscutting code. {level} may be * ignore, warning, or error. This overrides entries in org/aspectj/weaver/XlintDefault.properties from * aspectjtools.jar, but does not override levels set using the -Xlintfile option. - * <p/> + * </p> + * <p> * -Xlintfile PropertyFile - * <p/> + * </p> + * <p> * Specify properties file to set levels for specific crosscutting messages. PropertyFile is a path to a * Java .properties file that takes the same property names and values as * org/aspectj/weaver/XlintDefault.properties from aspectjtools.jar, which it also overrides. * -help - * <p/> + * </p> + * <p> * Emit information on compiler options and usage - * <p/> + * </p> + * <p> * -version - * <p/> + * </p> + * <p> * Emit the version of the AspectJ compiler - * <p/> + * </p> + * <p> * -classpath Path - * <p/> + * </p> + * <p> * Specify where to find user class files. Path is a single argument containing a list of paths to zip files * or directories, delimited by the platform-specific path delimiter. - * <p/> + * </p> + * <p> * -bootclasspath Path - * <p/> + * </p> + * <p> * Override location of VM's bootclasspath for purposes of evaluating types when compiling. Path is a single * argument containing a list of paths to zip files or directories, delimited by the platform-specific path * delimiter. - * <p/> + * </p> + * <p> * -extdirs Path - * <p/> + * </p> + * <p> * Override location of VM's extension directories for purposes of evaluating types when compiling. Path is * a single argument containing a list of paths to directories, delimited by the platform-specific path * delimiter. - * <p/> + * </p> + * <p> * -d Directory - * <p/> + * </p> + * <p> * Specify where to place generated .class files. If not specified, Directory defaults to the current * working dir. - * <p/> + * </p> + * <p> * -target [1.1|1.2] - * <p/> + * </p> + * <p> * Specify classfile target setting (1.1 or 1.2, default is 1.1) - * <p/> + * </p> + * <p> * -1.3 - * <p/> + * </p> + * <p> * Set compliance level to 1.3 (default) * -1.4 - * <p/> + * </p> + * <p> * Set compliance level to 1.4 * -source [1.3|1.4] - * <p/> + * </p> + * <p> * Toggle assertions (1.3 or 1.4, default is 1.3 in -1.3 mode and 1.4 in -1.4 mode). When using -source 1.3, * an assert() statement valid under Java 1.4 will result in a compiler error. When using -source 1.4, treat * assert as a keyword and implement assertions according to the 1.4 language spec. - * <p/> + * </p> + * <p> * -nowarn - * <p/> + * </p> + * <p> * Emit no warnings (equivalent to '-warn:none') This does not suppress messages generated by declare warning * or Xlint. - * <p/> + * </p> + * <p> * -warn: items - * <p/> + * </p> + * <p> * Emit warnings for any instances of the comma-delimited list of questionable code * (eg '-warn:unusedLocals,deprecation'): - * <p/> + * </p> + * <p> * constructorName method with constructor name * packageDefaultMethod attempt to override package-default method * deprecation usage of deprecated type or member @@ -147,78 +189,96 @@ import java.util.Map; * unusedArguments method argument never read * unusedImports import statement not used by code in file * none suppress all compiler warnings - * <p/> - * <p/> + * </p> + * <p> * -warn:none does not suppress messages generated by declare warning or Xlint. - * <p/> + * </p> + * <p> * -deprecation - * <p/> + * </p> + * <p> * Same as -warn:deprecation - * <p/> + * </p> + * <p> * -noImportError - * <p/> + * </p> + * <p> * Emit no errors for unresolved imports - * <p/> + * </p> + * <p> * -proceedOnError - * <p/> + * </p> + * <p> * Keep compiling after error, dumping class files with problem methods - * <p/> + * </p> + * <p> * -g:[lines,vars,source] - * <p/> + * </p> + * <p> * debug attributes level, that may take three forms: - * <p/> + * </p> + * <p> * -g all debug info ('-g:lines,vars,source') * -g:none no debug info * -g:{items} debug info for any/all of [lines, vars, source], e.g., * -g:lines,source - * <p/> - * <p/> + * </p> + * <p> * -preserveAllLocals - * <p/> + * </p> + * <p> * Preserve all local variables during code generation (to facilitate debugging). - * <p/> + * </p> + * <p> * -referenceInfo - * <p/> + * </p> + * <p> * Compute reference information. - * <p/> + * </p> + * <p> * -encoding format - * <p/> + * </p> + * <p> * Specify default source encoding format. Specify custom encoding on a per file basis by suffixing each * input source file/folder name with '[encoding]'. - * <p/> + * </p> + * <p> * -verbose - * <p/> + * </p> + * <p> * Emit messages about accessed/processed compilation units - * <p/> - * -log file - * <p/> - * Specify a log file for compiler messages. - * -progress - * <p/> - * Show progress (requires -log mode). - * -time - * <p/> - * Display speed information. - * -noExit - * <p/> - * Do not call System.exit(n) at end of compilation (n=0 if no error) - * -repeat N - * <p/> - * Repeat compilation process N times (typically to do performance analysis). - * -Xnoweave - * <p/> - * (Experimental) produce unwoven class files for input using -injars. - * -Xnoinline - * <p/> - * (Experimental) do not inline around advice + * </p> + * <p> + * -log file Specify a log file for compiler messages. + * </p> + * <p> + * -progress Show progress (requires -log mode). + * </p> + * <p> + * -time Display speed information. + * </p> + * <p> + * -noExit Do not call System.exit(n) at end of compilation (n=0 if no error) + * </p> + * <p> + * -repeat N Repeat compilation process N times (typically to do performance analysis). + * </p> + * <p> + * -Xnoweave (Experimental) produce unwoven class files for input using -injars. + * </p> + * <p> + * -Xnoinline (Experimental) do not inline around advice + * </p> + * <p> * -XincrementalFile file - * <p/> + * </p> + * <p> * (Experimental) This works like incremental mode, but using a file rather than standard input to control * the compiler. It will recompile each time file is changed and and halt when file is deleted. - * <p/> - * -XserializableAspects - * <p/> - * (Experimental) Normally it is an error to declare aspects Serializable. This option removes that restriction. + * </p> + * <p> + * -XserializableAspects (Experimental) Normally it is an error to declare aspects Serializable. This option removes that restriction. + * </p> * * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> * @plexus.component role="org.codehaus.plexus.compiler.Compiler" role-hint="aspectj" @@ -503,9 +563,21 @@ public class AspectJCompiler private void setSourceVersion( AjBuildConfig buildConfig, String sourceVersion ) throws CompilerException { - if ( "1.9".equals( sourceVersion ) ) + if ( "11".equals( sourceVersion ) ) { - buildConfig.getOptions().sourceLevel = ClassFileConstants.JDK1_9; + buildConfig.getOptions().sourceLevel = ClassFileConstants.JDK11; + } + else if ( "10".equals( sourceVersion ) ) + { + buildConfig.getOptions().sourceLevel = ClassFileConstants.JDK10; + } + else if ( "9".equals( sourceVersion ) ) + { + buildConfig.getOptions().sourceLevel = ClassFileConstants.JDK9; + } + else if ( "1.9".equals( sourceVersion ) ) + { + buildConfig.getOptions().sourceLevel = ClassFileConstants.JDK9; } else if ( "1.8".equals( sourceVersion ) ) { diff --git a/plexus-compilers/plexus-compiler-aspectj/src/test/java/org/codehaus/plexus/compiler/ajc/AspectJCompilerTest.java b/plexus-compilers/plexus-compiler-aspectj/src/test/java/org/codehaus/plexus/compiler/ajc/AspectJCompilerTest.java index b897b5632effa61439659fe6bafdeeffa1015574..e3c9835b107483d9452088066f9cabc346526810 100644 --- a/plexus-compilers/plexus-compiler-aspectj/src/test/java/org/codehaus/plexus/compiler/ajc/AspectJCompilerTest.java +++ b/plexus-compilers/plexus-compiler-aspectj/src/test/java/org/codehaus/plexus/compiler/ajc/AspectJCompilerTest.java @@ -28,7 +28,8 @@ public class AspectJCompilerTest { // olamy well I agree it's hackhish but I don't want to waste too much time with aspectj which is probably // not used a lot anymore... - if (getJavaVersion().startsWith( "9" ) || getJavaVersion().startsWith( "10" )) + String javaVersion = getJavaVersion(); + if (javaVersion.equals( "11" )) { return 11; } @@ -40,10 +41,10 @@ public class AspectJCompilerTest String javaVersion = System.getProperty( "java.version" ); // olamy well I agree it's hackhish but I don't want to waste too much time with aspectj which is probably // not used a lot anymore... - if (javaVersion.startsWith( "9" ) || javaVersion.startsWith( "10" )) - { - return Collections.emptyList(); - } +// if (javaVersion.startsWith( "9" ) || javaVersion.startsWith( "10" )) +// { +// return Collections.emptyList(); +// } return Arrays.asList( new String[]{ "org/codehaus/foo/ExternalDeps.class", "org/codehaus/foo/Person.class" } ); } diff --git a/plexus-compilers/plexus-compiler-csharp/pom.xml b/plexus-compilers/plexus-compiler-csharp/pom.xml index e28500bd1f95e8fac91f933024d9a43a9cc90b53..8de38f7d7ffb18b7abbbadaa12169a59da154770 100644 --- a/plexus-compilers/plexus-compiler-csharp/pom.xml +++ b/plexus-compilers/plexus-compiler-csharp/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compilers</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-csharp</artifactId> diff --git a/plexus-compilers/plexus-compiler-csharp/src/main/java/org/codehaus/plexus/compiler/csharp/DefaultCSharpCompilerParser.java b/plexus-compilers/plexus-compiler-csharp/src/main/java/org/codehaus/plexus/compiler/csharp/DefaultCSharpCompilerParser.java index 7fcf1feaa7f3ad63daab674df8333d75888d67c7..a548d3d451d98c5132d1dd16f17d164ddf7b80d1 100644 --- a/plexus-compilers/plexus-compiler-csharp/src/main/java/org/codehaus/plexus/compiler/csharp/DefaultCSharpCompilerParser.java +++ b/plexus-compilers/plexus-compiler-csharp/src/main/java/org/codehaus/plexus/compiler/csharp/DefaultCSharpCompilerParser.java @@ -5,11 +5,12 @@ import org.codehaus.plexus.util.StringUtils; /** * Handles output from both mono with only the line number - * <p/> + * <p> * ex error = "/home/trygvis/dev/com.myrealbox/trunk/mcs/nunit20/core/./TestRunnerThread.cs(29) error CS0246: Cannot find type 'NameValueCollection'" - * <p/> - * and errors from mono & csc on windows which has column num also - * <p/> + * </p> + * <p> + * and errors from mono & csc on windows which has column num also + * </p> * ex error = "src\\test\\csharp\\Hierarchy\\Logger.cs(98,4): warning CS0618: 'NUnit.Framework.Assertion' is obsolete: 'Use Assert class instead'"; * * @author <a href="mailto:gdodinet@karmicsoft.com">Gilles Dodinet</a> diff --git a/plexus-compilers/plexus-compiler-eclipse/pom.xml b/plexus-compilers/plexus-compiler-eclipse/pom.xml index 69337c9353ca7b8f376e2968c99a1ed5c798a4c0..8de9c77db03d25734062ce72cca33bc19b5cc350 100644 --- a/plexus-compilers/plexus-compiler-eclipse/pom.xml +++ b/plexus-compilers/plexus-compiler-eclipse/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compilers</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-eclipse</artifactId> @@ -21,7 +21,7 @@ <dependency> <groupId>org.eclipse.jdt</groupId> <artifactId>ecj</artifactId> - <version>3.13.100</version> + <version>3.15.1</version> </dependency> </dependencies> diff --git a/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java b/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java index 3f84de5ff81428c75e1c10508ad4041abec63094..d0ba5b20951490104a00d10f35e92af5f107fd86 100644 --- a/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java +++ b/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java @@ -30,21 +30,30 @@ import org.codehaus.plexus.compiler.CompilerException; import org.codehaus.plexus.compiler.CompilerMessage; import org.codehaus.plexus.compiler.CompilerOutputStyle; import org.codehaus.plexus.compiler.CompilerResult; +import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.StringUtils; import org.eclipse.jdt.core.compiler.CompilationProgress; import org.eclipse.jdt.core.compiler.batch.BatchCompiler; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; +import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.Collections; +import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Map.Entry; +import java.util.ServiceLoader; import java.util.Set; +import javax.tools.Diagnostic; +import javax.tools.DiagnosticListener; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; + /** * @plexus.component role="org.codehaus.plexus.compiler.Compiler" role-hint="eclipse" */ @@ -61,6 +70,7 @@ public class EclipseJavaCompiler // ---------------------------------------------------------------------- boolean errorsAsWarnings = false; + @Override public CompilerResult performCompile(CompilerConfiguration config ) throws CompilerException { @@ -240,97 +250,166 @@ public class EclipseJavaCompiler args.add("-classpath"); args.add(getPathString(classpathEntries)); - // Compile! Send all errors to xml temp file. - File errorF = null; - try + // Collect sources + List<String> allSources = new ArrayList<>(); + for (String source : config.getSourceLocations()) { - errorF = File.createTempFile("ecjerr-", ".xml"); - - args.add("-log"); - args.add(errorF.toString()); - - // Add all sources. - int argCount = args.size(); - for(String source : config.getSourceLocations()) + File srcFile = new File(source); + if (srcFile.exists()) { - File srcFile = new File(source); - if(srcFile.exists()) - { - Set<String> ss = getSourceFilesForSourceRoot(config, source); - args.addAll(ss); - } + Set<String> ss = getSourceFilesForSourceRoot(config, source); + allSources.addAll(ss); } - args.addAll(extraSourceDirs); - if(args.size() == argCount) - { - //-- Nothing to do -> bail out - return new CompilerResult(true, Collections.EMPTY_LIST); + } + for (String extraSrcDir : extraSourceDirs) { + File extraDir = new File(extraSrcDir); + if (extraDir.isDirectory()) { + addExtraSources(extraDir, allSources); } + } + List<CompilerMessage> messageList = new ArrayList<>(); + if (allSources.isEmpty()) { + // -- Nothing to do -> bail out + return new CompilerResult(true, messageList); + } - getLogger().debug("ecj command line: " + args); - + // Compile + try { StringWriter sw = new StringWriter(); PrintWriter devNull = new PrintWriter(sw); - - //BatchCompiler.compile(args.toArray(new String[args.size()]), new PrintWriter(System.err), new PrintWriter(System.out), new CompilationProgress() { - boolean success = BatchCompiler.compile(args.toArray(new String[args.size()]), devNull, devNull, new CompilationProgress() { - @Override - public void begin(int i) - { + JavaCompiler compiler = getEcj(); + boolean success = false; + if (compiler != null) { + getLogger().debug("Using JSR-199 EclipseCompiler"); + // ECJ JSR-199 compiles against the latest Java version it supports if no source + // version is given explicitly. BatchCompiler uses 1.3 as default. So check + // whether a source version is specified, and if not supply 1.3 explicitly. + String srcVersion = null; + Iterator<String> allArgs = args.iterator(); + while (allArgs.hasNext()) { + String option = allArgs.next(); + if ("-source".equals(option) && allArgs.hasNext()) { + srcVersion = allArgs.next(); + break; + } } - - @Override - public void done() - { + if (srcVersion == null) { + getLogger().debug("ecj: no source level specified, defaulting to Java 1.3"); + args.add("-source"); + args.add("1.3"); } + final Locale defaultLocale = Locale.getDefault(); + final List<CompilerMessage> messages = messageList; + DiagnosticListener<? super JavaFileObject> messageCollector = new DiagnosticListener<JavaFileObject>() { + + @Override + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + // Convert to Plexus' CompilerMessage and append to messageList + String fileName = "Unknown source"; + try { + JavaFileObject file = diagnostic.getSource(); + if (file != null) { + fileName = file.getName(); + } + } catch (NullPointerException e) { + // ECJ bug: diagnostic.getSource() may throw an NPE if there is no source + } + long startColumn = diagnostic.getColumnNumber(); + // endColumn may be wrong if the endPosition is not on the same line. + long endColumn = startColumn + (diagnostic.getEndPosition() - diagnostic.getStartPosition()); + CompilerMessage message = new CompilerMessage(fileName, + convert(diagnostic.getKind()), (int) diagnostic.getLineNumber(), (int) startColumn, + (int) diagnostic.getLineNumber(), (int) endColumn, + diagnostic.getMessage(defaultLocale)); + messages.add(message); + } + }; + StandardJavaFileManager manager = compiler.getStandardFileManager(messageCollector, defaultLocale, + Charset.defaultCharset()); - @Override - public boolean isCanceled() - { - return false; - } + getLogger().debug("ecj command line: " + args); + getLogger().debug("ecj input source files: " + allSources); - @Override - public void setTaskName(String s) - { + Iterable<? extends JavaFileObject> units = manager.getJavaFileObjectsFromStrings(allSources); + try { + success = Boolean.TRUE + .equals(compiler.getTask(devNull, manager, messageCollector, args, null, units).call()); + } catch (RuntimeException e) { + throw new EcjFailureException(e.getLocalizedMessage()); } - - @Override - public void worked(int i, int i1) - { + getLogger().debug(sw.toString()); + } else { + // Use the BatchCompiler and send all errors to xml temp file. + File errorF = null; + try { + errorF = File.createTempFile("ecjerr-", ".xml"); + getLogger().debug("Using legacy BatchCompiler; error file " + errorF); + + args.add("-log"); + args.add(errorF.toString()); + args.addAll(allSources); + + getLogger().debug("ecj command line: " + args); + + success = BatchCompiler.compile(args.toArray(new String[args.size()]), devNull, devNull, + new CompilationProgress() { + @Override + public void begin(int i) { + } + + @Override + public void done() { + } + + @Override + public boolean isCanceled() { + return false; + } + + @Override + public void setTaskName(String s) { + } + + @Override + public void worked(int i, int i1) { + } + }); + getLogger().debug(sw.toString()); + + if (errorF.length() < 80) { + throw new EcjFailureException(sw.toString()); + } + messageList = new EcjResponseParser().parse(errorF, errorsAsWarnings); + } finally { + if (null != errorF) { + try { + errorF.delete(); + } catch (Exception x) { + } + } } - }); - getLogger().debug(sw.toString()); - - List<CompilerMessage> messageList; - boolean hasError = false; - if(errorF.length() < 80) - { - throw new EcjFailureException(sw.toString()); } - messageList = new EcjResponseParser().parse(errorF, errorsAsWarnings); - - for(CompilerMessage compilerMessage : messageList) - { - if(compilerMessage.isError()) - { + boolean hasError = false; + for (CompilerMessage compilerMessage : messageList) { + if (compilerMessage.isError()) { hasError = true; break; } } - if(!hasError && !success && !errorsAsWarnings) - { - CompilerMessage.Kind kind = errorsAsWarnings ? CompilerMessage.Kind.WARNING : CompilerMessage.Kind.ERROR; - - //-- Compiler reported failure but we do not seem to have one -> probable exception - CompilerMessage cm = new CompilerMessage("[ecj] The compiler reported an error but has not written it to its logging", kind); + if (!hasError && !success && !errorsAsWarnings) { + CompilerMessage.Kind kind = errorsAsWarnings ? CompilerMessage.Kind.WARNING + : CompilerMessage.Kind.ERROR; + + // -- Compiler reported failure but we do not seem to have one -> probable + // exception + CompilerMessage cm = new CompilerMessage( + "[ecj] The compiler reported an error but has not written it to its logging", kind); messageList.add(cm); hasError = true; - //-- Try to find the actual message by reporting the last 5 lines as a message + // -- Try to find the actual message by reporting the last 5 lines as a message String stdout = getLastLines(sw.toString(), 5); - if(stdout.length() > 0) - { + if (stdout.length() > 0) { cm = new CompilerMessage("[ecj] The following line(s) might indicate the issue:\n" + stdout, kind); messageList.add(cm); } @@ -339,14 +418,58 @@ public class EclipseJavaCompiler } catch(EcjFailureException x) { throw x; } catch(Exception x) { - throw new RuntimeException(x); // sigh - } finally { - if(null != errorF) { - try { - errorF.delete(); - } catch(Exception x) {} + throw new RuntimeException(x); // sigh + } + } + + private JavaCompiler getEcj() { + ServiceLoader<JavaCompiler> javaCompilerLoader = ServiceLoader.load(JavaCompiler.class, + BatchCompiler.class.getClassLoader()); + Class<?> c = null; + try { + c = Class.forName("org.eclipse.jdt.internal.compiler.tool.EclipseCompiler", false, + BatchCompiler.class.getClassLoader()); + } catch (ClassNotFoundException e) { + // Ignore + } + if (c != null) { + for (JavaCompiler javaCompiler : javaCompilerLoader) { + if (c.isInstance(javaCompiler)) { + return javaCompiler; + } } } + getLogger().debug("Cannot find org.eclipse.jdt.internal.compiler.tool.EclipseCompiler"); + return null; + } + + private void addExtraSources(File dir, List<String> allSources) { + DirectoryScanner scanner = new DirectoryScanner(); + scanner.setBasedir(dir.getAbsolutePath()); + scanner.setIncludes(new String[] { "**/*.java" }); + scanner.scan(); + for (String file : scanner.getIncludedFiles()) { + allSources.add(new File(dir, file).getAbsolutePath()); + } + } + + private CompilerMessage.Kind convert(Diagnostic.Kind kind) { + if (kind == null) { + return CompilerMessage.Kind.OTHER; + } + switch (kind) { + case ERROR: + return errorsAsWarnings ? CompilerMessage.Kind.WARNING : CompilerMessage.Kind.ERROR; + case WARNING: + return CompilerMessage.Kind.WARNING; + case MANDATORY_WARNING: + return CompilerMessage.Kind.MANDATORY_WARNING; + case NOTE: + return CompilerMessage.Kind.NOTE; + case OTHER: + default: + return CompilerMessage.Kind.OTHER; + } } private String getLastLines(String text, int lines) @@ -396,6 +519,7 @@ public class EclipseJavaCompiler || s.startsWith( "1.1" ) || s.startsWith( "1.0" ); } + @Override public String[] createCommandLine( CompilerConfiguration config ) throws CompilerException { diff --git a/plexus-compilers/plexus-compiler-j2objc/pom.xml b/plexus-compilers/plexus-compiler-j2objc/pom.xml index f95f76d9f0c5869e74e8de97130313c9f7b78189..b325d72d3b39d22f03249b9f5f588f9ad55249e6 100644 --- a/plexus-compilers/plexus-compiler-j2objc/pom.xml +++ b/plexus-compilers/plexus-compiler-j2objc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compilers</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-j2objc</artifactId> diff --git a/plexus-compilers/plexus-compiler-javac-errorprone/pom.xml b/plexus-compilers/plexus-compiler-javac-errorprone/pom.xml index 7569ba91f12a6cea02341103916c94e86a498406..569700a02155073fcd08bb8d340f84ed14d260fb 100644 --- a/plexus-compilers/plexus-compiler-javac-errorprone/pom.xml +++ b/plexus-compilers/plexus-compiler-javac-errorprone/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compilers</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-javac-errorprone</artifactId> @@ -29,7 +29,7 @@ <dependency> <groupId>com.google.errorprone</groupId> <artifactId>error_prone_core</artifactId> - <version>2.2.0</version> + <version>2.3.2</version> </dependency> </dependencies> diff --git a/plexus-compilers/plexus-compiler-javac/pom.xml b/plexus-compilers/plexus-compiler-javac/pom.xml index d7c0c177bc3140034eefe3987397d41b0c4688bd..8fb00cb1d6356ad7fe0034f0284b4c9c86474671 100644 --- a/plexus-compilers/plexus-compiler-javac/pom.xml +++ b/plexus-compilers/plexus-compiler-javac/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compilers</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-javac</artifactId> diff --git a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java index a4994b0d034c31d314caca79f3f9310d3ff044b0..8f92a64c519d18c2f93e37aeca94366927f93719 100644 --- a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java +++ b/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java @@ -679,9 +679,22 @@ public class JavacCompiler { // javac output not detected by other parsing // maybe better to ignore only the summary an mark the rest as error - if (buffer.length() > 0 && buffer.toString().startsWith("javac:")) + String bufferAsString = buffer.toString(); + if ( buffer.length() > 0 ) { - errors.add( new CompilerMessage( buffer.toString(), CompilerMessage.Kind.ERROR ) ); + if ( bufferAsString.startsWith("javac:")) + { + errors.add( new CompilerMessage( bufferAsString, CompilerMessage.Kind.ERROR ) ); + } + else if ( bufferAsString.startsWith("Error occurred during initialization of boot layer")) + { + errors.add( new CompilerMessage( bufferAsString, CompilerMessage.Kind.OTHER ) ); + } + else if ( hasPointer ) + { + //A compiler message remains in buffer at end of parse stream + errors.add( parseModernError( exitCode, bufferAsString ) ); + } } return errors; } diff --git a/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/AbstractJavacCompilerTest.java b/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/AbstractJavacCompilerTest.java index 76359d86a6e247dafd019adaae8b218b127e75b7..fdee03637392eb4fb0bc39f496b8aa2e75223049 100644 --- a/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/AbstractJavacCompilerTest.java +++ b/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/AbstractJavacCompilerTest.java @@ -60,14 +60,14 @@ public abstract class AbstractJavacCompilerTest protected int expectedErrors() { - - if (getJavaVersion().contains("9.0")){ + String javaVersion = getJavaVersion(); + if (javaVersion.contains("9.0")||javaVersion.contains("11")){ // lots of new warnings about obsoletions for future releases return 5; } // javac output changed for misspelled modifiers starting in 1.6...they now generate 2 errors per occurrence, not one. - if ( "1.5".compareTo( getJavaVersion() ) < 0 ) + if ( "1.5".compareTo( javaVersion ) < 0 ) { return 4; } @@ -79,18 +79,21 @@ public abstract class AbstractJavacCompilerTest protected int expectedWarnings() { - if (getJavaVersion().contains("9.0")){ + String javaVersion = getJavaVersion(); + if (javaVersion.contains("11")){ + return 1; + } + if (javaVersion.contains("9.0")){ // lots of new warnings about obsoletions for future releases return 8; } - - if (getJavaVersion().contains("1.8")){ + if (javaVersion.contains("1.8")){ // lots of new warnings about obsoletions for future releases return 30; } - if ( "1.6".compareTo( getJavaVersion() ) < 0 ) + if ( "1.6".compareTo( javaVersion ) < 0 ) { // with 1.7 some warning with bootstrap class path not set in conjunction with -source 1.3 return 9; @@ -102,24 +105,33 @@ public abstract class AbstractJavacCompilerTest @Override public String getTargetVersion() { - if (getJavaVersion().contains("9.0")){ + String javaVersion = getJavaVersion(); + if (javaVersion.contains("9.0")){ return "1.7"; } + if (javaVersion.contains("11")){ + return "11"; + } return super.getTargetVersion(); } @Override public String getSourceVersion() { - if (getJavaVersion().contains("9.0")){ + String javaVersion = getJavaVersion(); + if (javaVersion.contains("9.0")){ return "1.7"; } + if (javaVersion.contains("11")){ + return "11"; + } return super.getTargetVersion(); } protected Collection<String> expectedOutputFiles() { - if (getJavaVersion().contains("9.0")){ + String javaVersion = getJavaVersion(); + if (javaVersion.contains("9.0")||javaVersion.contains("11")){ return Arrays.asList( new String[]{ "org/codehaus/foo/Deprecation.class", "org/codehaus/foo/ExternalDeps.class", "org/codehaus/foo/Person.class"} ); } @@ -142,7 +154,7 @@ public abstract class AbstractJavacCompilerTest public void testBuildCompilerArgs13() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -155,7 +167,7 @@ public abstract class AbstractJavacCompilerTest public void testBuildCompilerArgs14() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -168,7 +180,7 @@ public abstract class AbstractJavacCompilerTest public void testBuildCompilerArgs15() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -181,7 +193,7 @@ public abstract class AbstractJavacCompilerTest public void testBuildCompilerArgs18() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -194,7 +206,7 @@ public abstract class AbstractJavacCompilerTest public void testBuildCompilerArgsUnspecifiedVersion() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -205,7 +217,7 @@ public abstract class AbstractJavacCompilerTest public void testBuildCompilerDebugLevel() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -221,7 +233,7 @@ public abstract class AbstractJavacCompilerTest // PLXCOMP-190 public void testJRuntimeArguments() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -251,7 +263,7 @@ public abstract class AbstractJavacCompilerTest public void testModulePath() throws Exception { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -278,7 +290,7 @@ public abstract class AbstractJavacCompilerTest public void testModuleVersion() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -303,7 +315,7 @@ public abstract class AbstractJavacCompilerTest public void testReleaseVersion() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -322,7 +334,7 @@ public abstract class AbstractJavacCompilerTest public void testFailOnWarning() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); @@ -346,7 +358,7 @@ public abstract class AbstractJavacCompilerTest public void testMultipleAddExports() { - List<String> expectedArguments = new ArrayList<String>(); + List<String> expectedArguments = new ArrayList<>(); CompilerConfiguration compilerConfiguration = new CompilerConfiguration(); diff --git a/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/ErrorMessageParserTest.java b/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/ErrorMessageParserTest.java index 676b98f0d61138985494f44971b21f2562a6e99d..cb14c8bb40129060e1998e6b2f68316b782d35bb 100644 --- a/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/ErrorMessageParserTest.java +++ b/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/ErrorMessageParserTest.java @@ -894,6 +894,71 @@ public class ErrorMessageParserTest ".tools.javac.Main.main(Main.java:43)" + EOL)); } + public void testJvmError() throws Exception + { + String out = "Error occurred during initialization of boot layer" + EOL + + "java.lang.module.FindException: Module java.xml.bind not found"; + + List<CompilerMessage> compilerErrors = JavacCompiler.parseModernStream( 1, new BufferedReader( new StringReader( out ) )); + + assertNotNull( compilerErrors ); + + assertEquals( 1, compilerErrors.size() ); + } + + public void testBadSourceFileError() throws Exception + { + String out = "/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java:12: error: cannot access Cls2\n" + + " Cls2 tvar;\n" + + " ^\n" + + " bad source file: /MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls2.java\n" + + " file does not contain class ch.pecunifex.x.Cls2\n" + + " Please remove or make sure it appears in the correct subdirectory of the sourcepath."; + + List<CompilerMessage> compilerErrors = JavacCompiler.parseModernStream( 1, new BufferedReader( new StringReader( out ) )); + + assertNotNull( compilerErrors ); + + assertEquals( 1, compilerErrors.size() ); + + final CompilerMessage message = compilerErrors.get( 0 ); + validateBadSourceFile(message); + } + + public void testWarningFollowedByBadSourceFileError() throws Exception + { + String out = "/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java:3: warning: FontDesignMetrics is internal proprietary API and may be removed in a future release\n" + + "import sun.font.FontDesignMetrics;\n" + + " ^\n" + + "/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java:12: error: cannot access Cls2\n" + + " Cls2 tvar;\n" + + " ^\n" + + " bad source file: /MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls2.java\n" + + " file does not contain class ch.pecunifex.x.Cls2\n" + + " Please remove or make sure it appears in the correct subdirectory of the sourcepath."; + + List<CompilerMessage> compilerErrors = JavacCompiler.parseModernStream( 1, new BufferedReader( new StringReader( out ) )); + + assertNotNull( compilerErrors ); + + assertEquals( 2, compilerErrors.size() ); + + final CompilerMessage firstMessage = compilerErrors.get( 0 ); + assertEquals( "Is a Warning", CompilerMessage.Kind.WARNING, firstMessage.getKind() ); + assertEquals( "On Correct File","/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java", firstMessage.getFile() ); + assertEquals( "Internal API Warning", "FontDesignMetrics is internal proprietary API and may be removed in a future release", firstMessage.getMessage() ); + + final CompilerMessage secondMessage = compilerErrors.get( 1 ); + validateBadSourceFile(secondMessage); + } + + private void validateBadSourceFile(CompilerMessage message) + { + assertEquals( "Is an Error", CompilerMessage.Kind.ERROR, message.getKind() ); + assertEquals( "On Correct File","/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java", message.getFile() ); + assertTrue( "Message starts with access Error", message.getMessage().startsWith("error: cannot access Cls2") ); + } + private static void assertEquivalent(CompilerMessage expected, CompilerMessage actual){ assertEquals("Message did not match", expected.getMessage(), actual.getMessage()); assertEquals("Kind did not match", expected.getKind(), actual.getKind()); diff --git a/plexus-compilers/plexus-compiler-jikes/pom.xml b/plexus-compilers/plexus-compiler-jikes/pom.xml index 0450b3dd821fb9fc215d7e631c9fc4bd77d42f98..968fab551a6b8846185b44c9b572f98debc77d9a 100644 --- a/plexus-compilers/plexus-compiler-jikes/pom.xml +++ b/plexus-compilers/plexus-compiler-jikes/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compilers</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compiler-jikes</artifactId> diff --git a/plexus-compilers/pom.xml b/plexus-compilers/pom.xml index e03d2d1b08f70ef4c27a93384b244e62a7bf1635..bbdc4375552c9b015fed50c91fd19e2ea1ea204c 100644 --- a/plexus-compilers/pom.xml +++ b/plexus-compilers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compiler</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> </parent> <artifactId>plexus-compilers</artifactId> diff --git a/pom.xml b/pom.xml index 78a2fc0d7c41c8a00762d4e7591119fda997d3db..31869c602a7c97578a2b55837b0c5dff234275b4 100644 --- a/pom.xml +++ b/pom.xml @@ -6,11 +6,11 @@ <parent> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-components</artifactId> - <version>4.0</version> + <version>6.1</version> </parent> <artifactId>plexus-compiler</artifactId> - <version>2.8.5</version> + <version>2.8.6</version> <packaging>pom</packaging> <name>Plexus Compiler</name> @@ -27,7 +27,7 @@ <connection>${scm.url}</connection> <developerConnection>${scm.url}</developerConnection> <url>http://github.com/codehaus-plexus/plexus-compiler/tree/${project.scm.tag}/</url> - <tag>plexus-compiler-2.8.5</tag> + <tag>plexus-compiler-2.8.6</tag> </scm> <issueManagement> <system>github</system> @@ -44,6 +44,7 @@ <scm.url>scm:git:git@github.com:codehaus-plexus/plexus-compiler.git</scm.url> <javaVersion>7</javaVersion> <redirectTestOutputToFile>true</redirectTestOutputToFile> + <project.build.outputTimestamp>2020-02-16T01:15:35Z</project.build.outputTimestamp> </properties> <dependencyManagement> @@ -85,7 +86,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.20</version> + <version>2.22.1</version> <configuration> <redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile> </configuration> @@ -103,6 +104,13 @@ <artifactId>maven-javadoc-plugin</artifactId> <configuration> <additionalparam>-Xdoclint:none</additionalparam> + <tagletArtifacts> + <tagletArtifact combine.id="org.codehaus.plexus:plexus-javadoc"> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-javadoc</artifactId> + <version>1.0</version> + </tagletArtifact> + </tagletArtifacts> </configuration> </plugin> </plugins> @@ -148,6 +156,29 @@ </execution> </executions> </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>3.0.0-M2</version> + <executions> + <execution> + <id>enforce-java</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireJavaVersion> + <version>[1.8,)</version> + <message>[ERROR] OLD JDK [${java.version}] in use. This projects requires JDK 8 or newer</message> + </requireJavaVersion> + </rules> + </configuration> + </execution> + </executions> + </plugin> + </plugins> </build> diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt index 8f7eb410b43f70e96a3ca0c53605fd54db79a380..5bdc150d900c4d822783d2352fe97dae3f75cc09 100644 --- a/src/site/apt/index.apt +++ b/src/site/apt/index.apt @@ -46,7 +46,7 @@ Plexus Compiler * {{{./plexus-compilers/plexus-compiler-javac/}<<<plexus-compiler-javac>>>}}: javac compiler, - * {{{./plexus-compilers/plexus-compiler-javac-errorprone/}<<<plexus-compiler-javac-errorprone>>>}}: javac compiler with {{{http://error-prone.googlecode.com}error-prone}} static analysis checks enabled , + * {{{./plexus-compilers/plexus-compiler-javac-errorprone/}<<<plexus-compiler-javac-errorprone>>>}}: javac compiler with {{{https://errorprone.info}error-prone}} static analysis checks enabled, * {{{./plexus-compilers/plexus-compiler-jikes/}<<<plexus-compiler-jikes>>>}}: jikes compiler,