Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21135

Build fails on windows as it fails to parse windows path during license check

    XMLWordPrintableJSON

Details

    Description

      License check via enforce plugin throws following error during build on windows:

      Sourced file: inline evaluation of: ``File license = new File("D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-ar . . . '' Token Parsing Error: Lexical error at line 1, column 29.  Encountered: "D" (68), after : "\"D:\\": <at unknown location>

      Complete stacktrace with command

      mvn clean install -DskipTests -X
      

      is as follows:

      [INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (check-aggregate-license) @ hbase-shaded ---
      [DEBUG] Configuring mojo org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader@55f96302]
      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce' with basic configurator -->
      [DEBUG]   (s) fail = true
      [DEBUG]   (s) failFast = false
      [DEBUG]   (f) ignoreCache = false
      [DEBUG]   (f) mojoExecution = org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce {execution: check-aggregate-license}
      [DEBUG]   (s) project = MavenProject: org.apache.hbase:hbase-shaded:2.1.1-SNAPSHOT @ D:\DS\HBase_2\hbase\hbase-shaded\pom.xml
      [DEBUG]   (s) condition = File license = new File("D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-archive-resources/META-INF/LICENSE");
      
                          // Beanshell does not support try-with-resources,
                          // so we must close this scanner manually
                          Scanner scanner = new Scanner(license);
      
                          while (scanner.hasNextLine()) {
                            if (scanner.nextLine().startsWith("ERROR:")) {
                              scanner.close();
                              return false;
                            }
                          }
                          scanner.close();
                          return true;
      [DEBUG]   (s) message = License errors detected, for more detail find ERROR in
                          D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-archive-resources/META-INF/LICENSE
      [DEBUG]   (s) rules = [org.apache.maven.plugins.enforcer.EvaluateBeanshell@7e307087]
      [DEBUG]   (s) session = org.apache.maven.execution.MavenSession@5e1218b4
      [DEBUG]   (s) skip = false
      [DEBUG] -- end configuration --
      [DEBUG] Executing rule: org.apache.maven.plugins.enforcer.EvaluateBeanshell
      [DEBUG] Echo condition : File license = new File("D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-archive-resources/META-INF/LICENSE");
      
                          // Beanshell does not support try-with-resources,
                          // so we must close this scanner manually
                          Scanner scanner = new Scanner(license);
      
                          while (scanner.hasNextLine()) {
                            if (scanner.nextLine().startsWith("ERROR:")) {
                              scanner.close();
                              return false;
                            }
                          }
                          scanner.close();
                          return true;
      [DEBUG] Echo script : File license = new File("D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-archive-resources/META-INF/LICENSE");
      
                          // Beanshell does not support try-with-resources,
                          // so we must close this scanner manually
                          Scanner scanner = new Scanner(license);
      
                          while (scanner.hasNextLine()) {
                            if (scanner.nextLine().startsWith("ERROR:")) {
                              scanner.close();
                              return false;
                            }
                          }
                          scanner.close();
                          return true;
      [DEBUG] Adding failure due to exception
      org.apache.maven.enforcer.rule.api.EnforcerRuleException: Couldn't evaluate condition: File license = new File("D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-archive-resources/META-INF/LICENSE");
      
                          // Beanshell does not support try-with-resources,
                          // so we must close this scanner manually
                          Scanner scanner = new Scanner(license);
      
                          while (scanner.hasNextLine()) {
                            if (scanner.nextLine().startsWith("ERROR:")) {
                              scanner.close();
                              return false;
                            }
                          }
                          scanner.close();
                          return true;
              at org.apache.maven.plugins.enforcer.EvaluateBeanshell.evaluateCondition(EvaluateBeanshell.java:107)
              at org.apache.maven.plugins.enforcer.EvaluateBeanshell.execute(EvaluateBeanshell.java:72)
              at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:202)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
              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:51)
              at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
              at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
              at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
              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:289)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: Sourced file: inline evaluation of: ``File license = new File("D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-ar . . . '' Token Parsing Error: Lexical error at line 1, column 29.  Encountered: "D" (68), after : "\"D:\\": <at unknown location>
      
              at bsh.Interpreter.eval(Unknown Source)
              at bsh.Interpreter.eval(Unknown Source)
              at bsh.Interpreter.eval(Unknown Source)
              at org.apache.maven.plugins.enforcer.EvaluateBeanshell.evaluateCondition(EvaluateBeanshell.java:102)
              ... 24 more
      [WARNING] Rule 0: org.apache.maven.plugins.enforcer.EvaluateBeanshell failed with message:
      Couldn't evaluate condition: File license = new File("D:\DS\HBase_2\hbase\hbase-shaded\target/maven-shared-archive-resources/META-INF/LICENSE");
      
                          // Beanshell does not support try-with-resources,
                          // so we must close this scanner manually
                          Scanner scanner = new Scanner(license);
      
                          while (scanner.hasNextLine()) {
                            if (scanner.nextLine().startsWith("ERROR:")) {
                              scanner.close();
                              return false;
                            }
                          }
                          scanner.close();
                          return true;
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO]
      [INFO] Apache HBase - Shaded .............................. FAILURE [  2.388 s]
      [INFO] Apache HBase - Shaded - Client (with Hadoop bundled) SKIPPED
      [INFO] Apache HBase - Shaded - Client ..................... SKIPPED
      [INFO] Apache HBase - Shaded - MapReduce .................. SKIPPED
      [INFO] Apache HBase - External Block Cache ................ SKIPPED
      [INFO] Apache HBase - Assembly ............................ SKIPPED
      [INFO] Apache HBase Shaded Packaging Invariants ........... SKIPPED
      [INFO] Apache HBase Shaded Packaging Invariants (with Hadoop bundled) SKIPPED
      [INFO] Apache HBase - Archetypes .......................... SKIPPED
      [INFO] Apache HBase - Exemplar for hbase-client archetype . SKIPPED
      [INFO] Apache HBase - Exemplar for hbase-shaded-client archetype SKIPPED
      [INFO] Apache HBase - Archetype builder ................... SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4.822 s
      [INFO] Finished at: 2018-08-31T15:39:00+05:30
      [INFO] Final Memory: 41M/421M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (check-aggregate-license) on project hbase-shaded: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (check-aggregate-license) on project hbase-shaded: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
              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:51)
              at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
              at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
              at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
              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:289)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
              at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:243)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
              ... 20 more
      [ERROR]
      [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/MojoExecutionException
      

       

      Attachments

        1. HBASE-21135.master.001.patch
          2 kB
          Nihal Jain
        2. HBASE-21135-addendum.patch
          1.0 kB
          Andrew Kyle Purtell

        Issue Links

          Activity

            People

              nihaljain.cs Nihal Jain
              nihaljain.cs Nihal Jain
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: