Class EclipseJavaCompiler

  • All Implemented Interfaces:
    Compiler, org.codehaus.plexus.logging.LogEnabled

    public class EclipseJavaCompiler
    extends AbstractCompiler
    • Field Detail

      • errorsAsWarnings

        boolean errorsAsWarnings
    • Constructor Detail

      • EclipseJavaCompiler

        public EclipseJavaCompiler()
    • Method Detail

      • getEcj

        private javax.tools.JavaCompiler getEcj()
      • addExtraSources

        private void addExtraSources​(java.io.File dir,
                                     java.util.List<java.lang.String> allSources)
      • getLastLines

        private java.lang.String getLastLines​(java.lang.String text,
                                              int lines)
      • append

        private static void append​(java.lang.StringBuilder warns,
                                   java.lang.String s)
      • createCommandLine

        public java.lang.String[] createCommandLine​(CompilerConfiguration config)
                                             throws CompilerException
        Description copied from interface: Compiler
        Create the command line that would be executed using this configuration. If this particular compiler has no concept of a command line then returns null.
        Parameters:
        config - the CompilerConfiguration describing the compilation
        Returns:
        an array of Strings that make up the command line, or null if this compiler has no concept of command line
        Throws:
        CompilerException - if there was an error generating the command line
      • decodeVersion

        private java.lang.String decodeVersion​(java.lang.String versionSpec)
        Change any Maven Java version number to ECJ's version number. Do not check the validity of the version: the compiler does that nicely, and this allows compiler updates without changing the compiler plugin. This is important with the half year release cycle for Java.