skip to Main Content

I am trying to compile the closure-compiler, following the instructions here:

https://github.com/google/closure-compiler

javac -version
javac 1.8.0_232

mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_232, vendor: Private Build
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.10.0-1062.7.1.el7.x86_64", arch: "amd64", family: "unix"

When I execute: mvn -DskipTests -pl externs/pom.xml,pom-main.xml,pom-main-shaded.xml

.
.
.
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ closure-compiler ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 763 source files to /workspace/closure-compiler/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[WARNING] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[INFO] 9 warnings
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Closure Compiler Externs ........................... SUCCESS [  2.195 s]
[INFO] Closure Compiler Main .............................. SUCCESS [  1.312 s]
[INFO] Closure Compiler ................................... FAILURE [ 33.755 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.156 s
[INFO] Finished at: 2020-01-09T16:51:45+00:00
[INFO] Final Memory: 18M/61M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project closure-compiler: Compilation failure: Compilation failure:
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/ant/AntErrorManager.java:[19,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/refactoring/FixingErrorManager.java:[30,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] /workspace/closure-compiler/src/com/google/javascript/jscomp/deps/JsFileFullParser.java:[27,35] [deprecation] BasicErrorManager in com.google.javascript.jscomp has been deprecated
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :closure-compiler

This is happening on an Ubuntu 16.04.2 LTS, but I experienced the same issue on centos 7.

Can someone explain what’s going on?

Update:

I modified the pom.xml and removed the deprecation

<compilerArgument>-Xlint:unchecked,deprecation,fallthrough,finally</compilerArgument>

Now the build fails with:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project closure-compiler: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project closure-compiler: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1224)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:4

06)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

2

Answers


  1. No idea if this is the same issue but I had something similar with Ubuntu 18.04. Turns out I only had the JRE installed and not the JDK. After running sudo apt install openjdk-8-jdk it compiled, no problem.

    Login or Signup to reply.
  2. This is the plugin i used in maven for minification of Javascript part of my project. It minifies all .js files and overwrites them at build phase. I hope this will help

            <plugin>
                <groupId>com.github.blutorange</groupId>
                <artifactId>closure-compiler-maven-plugin</artifactId>
                <version>2.16.0</version>
                <configuration>
                    <baseSourceDir>${project.basedir}srcmainresourcespublicassets</baseSourceDir>
                    <baseTargetDir>${project.build.directory}classespublicassets</baseTargetDir>
                </configuration>
                <executions>
                    <execution>
                        <id>default-minify</id>
                        <configuration>
                            <encoding>UTF-8</encoding>
                            <sourceDir></sourceDir>
                            <outputFilename>#{path}/#{basename}.#{extension}</outputFilename>
                            <targetDir></targetDir>
                            <includes>**/*.js</includes>
                            <excludes>
                                <exclude>**/*.min.js</exclude>
                            </excludes>
                            <skipMerge>true</skipMerge>
                            <closureLanguageOut>ECMASCRIPT5</closureLanguageOut>
                        </configuration>
                        <goals>
                            <goal>minify</goal>
                        </goals>
                        <phase>generate-resources</phase>
                    </execution>
                </executions>
            </plugin>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search