OpenJPA
  1. OpenJPA
  2. OPENJPA-2418

Cannot build 2.2.x due to NullPointerException in maven-checkstyle-plugin

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.1.2, 2.2.3, 2.3.0
    • Fix Version/s: 2.2.3, 2.3.0
    • Component/s: build / infrastructure
    • Labels:
      None
    • Environment:

      Description

      Here's the issue when building the 2.2.x branch.

      Updating to newer maven-checkstyle-plugin (2.6) seems to workaround it.

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.4:checkstyle (default) on project openjpa-lib: Execution default of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.4:checkstyle failed. NullPointerException -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.4:checkstyle (default) on project openjpa-lib: Execution default of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.4:checkstyle failed.
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.4:checkstyle failed.
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	... 19 more
      Caused by: java.lang.NullPointerException
      	at org.apache.maven.plugin.checkstyle.rss.DefaultCheckstyleRssGenerator.generateRSS(DefaultCheckstyleRssGenerator.java:72)
      	at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:639)
      	at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:131)
      	at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:76)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      	... 20 more
      

        Activity

        Hide
        Rick Curtis added a comment -

        I'm running maven 2.2.1 and when I change to checkstyle 2.6 I get the following exception :

        [ERROR] FATAL ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] null
        [INFO] ------------------------------------------------------------------------
        [INFO] Trace
        java.lang.StringIndexOutOfBoundsException
        at java.lang.String.substring(String.java:1093)
        at org.codehaus.classworlds.UrlUtils.normalizeUrlPath(UrlUtils.java:28)
        at org.codehaus.classworlds.DefaultClassRealm.getResource(DefaultClassRealm.java:284)
        at org.codehaus.classworlds.RealmClassLoader.getResource(RealmClassLoader.java:237)
        at org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader.getResource(ThreadContextClasspathResourceLoader.java:63)
        at org.codehaus.plexus.resource.DefaultResourceManager.getResource(DefaultResourceManager.java:159)
        at org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:91)
        at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfigFile(DefaultCheckstyleExecutor.java:471)
        at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfiguration(DefaultCheckstyleExecutor.java:236)
        at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:173)
        at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:578)
        at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)
        at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:99)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

        Show
        Rick Curtis added a comment - I'm running maven 2.2.1 and when I change to checkstyle 2.6 I get the following exception : [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] null [INFO] ------------------------------------------------------------------------ [INFO] Trace java.lang.StringIndexOutOfBoundsException at java.lang.String.substring(String.java:1093) at org.codehaus.classworlds.UrlUtils.normalizeUrlPath(UrlUtils.java:28) at org.codehaus.classworlds.DefaultClassRealm.getResource(DefaultClassRealm.java:284) at org.codehaus.classworlds.RealmClassLoader.getResource(RealmClassLoader.java:237) at org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader.getResource(ThreadContextClasspathResourceLoader.java:63) at org.codehaus.plexus.resource.DefaultResourceManager.getResource(DefaultResourceManager.java:159) at org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:91) at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfigFile(DefaultCheckstyleExecutor.java:471) at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfiguration(DefaultCheckstyleExecutor.java:236) at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:173) at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:578) at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190) at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:99) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        Hide
        Rick Curtis added a comment -

        If I change <checkstyle.config.location> and <checkstyle.suppressions.location> to use $

        {file.separator}

        rather than '/', everything seems to work on both versions. Can I have you check that also?

        Show
        Rick Curtis added a comment - If I change <checkstyle.config.location> and <checkstyle.suppressions.location> to use $ {file.separator} rather than '/', everything seems to work on both versions. Can I have you check that also?
        Hide
        Kevin Sutter added a comment -

        I see that you are using Maven 3.0.3. OpenJPA currently states a build dependency on Maven 2.2.1. If you build with Maven 2.2.1, there is no problem. Do you have a requirement to use Maven 3.x? We could consider moving up to Maven 3 on trunk, but doing so on a service branch may introduce some unexpected build dependencies. We'd have to see if this move to Maven 3 is a big deal or not... Input would be appreciated. Thanks.

        Show
        Kevin Sutter added a comment - I see that you are using Maven 3.0.3. OpenJPA currently states a build dependency on Maven 2.2.1. If you build with Maven 2.2.1, there is no problem. Do you have a requirement to use Maven 3.x? We could consider moving up to Maven 3 on trunk, but doing so on a service branch may introduce some unexpected build dependencies. We'd have to see if this move to Maven 3 is a big deal or not... Input would be appreciated. Thanks.
        Hide
        ASF subversion and git services added a comment -

        Commit 1511367 from Rick Curtis in branch 'openjpa/trunk'
        [ https://svn.apache.org/r1511367 ]

        OPENJPA-2418 : Fix checkstyle to run with maven 3.x.

        Show
        ASF subversion and git services added a comment - Commit 1511367 from Rick Curtis in branch 'openjpa/trunk' [ https://svn.apache.org/r1511367 ] OPENJPA-2418 : Fix checkstyle to run with maven 3.x.
        Hide
        ASF subversion and git services added a comment -

        Commit 1511418 from Rick Curtis in branch 'openjpa/branches/2.2.x'
        [ https://svn.apache.org/r1511418 ]

        OPENJPA-2418: Fix checkstyle to run with maven 3.x.

        Show
        ASF subversion and git services added a comment - Commit 1511418 from Rick Curtis in branch 'openjpa/branches/2.2.x' [ https://svn.apache.org/r1511418 ] OPENJPA-2418 : Fix checkstyle to run with maven 3.x.
        Hide
        Rick Curtis added a comment -

        I committed changes to trunk and 2.2.x.

        Show
        Rick Curtis added a comment - I committed changes to trunk and 2.2.x.
        Hide
        Scott Parkerson added a comment - - edited

        Kevin Sutter: I guess I didn't read too carefully w/r/t to Maven 2.2.1 being a build requirement; I made bad assumption that since Maven 3.x has been out for some time now that there wouldn't be a problem.

        Rick Curtis: I've pulled the changes and confirmed them in 2.2.x, which is good enough for me.

        Show
        Scott Parkerson added a comment - - edited Kevin Sutter : I guess I didn't read too carefully w/r/t to Maven 2.2.1 being a build requirement; I made bad assumption that since Maven 3.x has been out for some time now that there wouldn't be a problem. Rick Curtis : I've pulled the changes and confirmed them in 2.2.x, which is good enough for me.
        Hide
        Scott Parkerson added a comment -

        Looks good from my end.

        Show
        Scott Parkerson added a comment - Looks good from my end.

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Scott Parkerson
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development