SonarQube Runner
  1. SonarQube Runner
  2. SONARUNNER-17

Make it possible to use a pattern like "lib/*.jar" to define the value of the 'libraries' property

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Such pattern will prevent having to list all dependencies.

        Issue Links

          Activity

          Hide
          Evgeny Mandrikov added a comment -

          Done in r4845.

          Show
          Evgeny Mandrikov added a comment - Done in r4845 .
          Hide
          Freddy Mallet added a comment - - edited

          Manually tested, works well except when the pattern value is incorrect.

          For instance, when using "*/*.jar" we get the following NullPointerException instead of a meaningful error message :

          Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: java.lang.NullPointerException
          	at org.sonar.runner.Runner.delegateExecution(Runner.java:182)
          	at org.sonar.runner.Runner.execute(Runner.java:78)
          	at org.sonar.runner.Main.main(Main.java:56)
          Caused by: java.lang.NullPointerException
          	at org.sonar.runner.Launcher.defineProject(Launcher.java:99)
          	at org.sonar.runner.Launcher.executeBatch(Launcher.java:61)
          	at org.sonar.runner.Launcher.execute(Launcher.java:57)
          	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.sonar.runner.Runner.delegateExecution(Runner.java:179)
          	... 2 more
          
          Show
          Freddy Mallet added a comment - - edited Manually tested, works well except when the pattern value is incorrect. For instance, when using "*/*.jar" we get the following NullPointerException instead of a meaningful error message : Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: java.lang.NullPointerException at org.sonar.runner.Runner.delegateExecution(Runner.java:182) at org.sonar.runner.Runner.execute(Runner.java:78) at org.sonar.runner.Main.main(Main.java:56) Caused by: java.lang.NullPointerException at org.sonar.runner.Launcher.defineProject(Launcher.java:99) at org.sonar.runner.Launcher.executeBatch(Launcher.java:61) at org.sonar.runner.Launcher.execute(Launcher.java:57) 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.sonar.runner.Runner.delegateExecution(Runner.java:179) ... 2 more
          Hide
          Evgeny Mandrikov added a comment - - edited

          In case of "*/*.jar" happens following : we try to find files "*.jar" in directory "*", which doesn't exist, so method File#listFiles(FileFilter) returns null.
          Now (r4854) exception would be thrown if there is no files matching pattern (even if directory exists):

          No files matching pattern "*.jar" in directory "/project/*"
          
          Show
          Evgeny Mandrikov added a comment - - edited In case of "*/*.jar" happens following : we try to find files "*.jar" in directory "*", which doesn't exist, so method File#listFiles(FileFilter) returns null. Now ( r4854 ) exception would be thrown if there is no files matching pattern (even if directory exists): No files matching pattern "*.jar" in directory "/project/*"
          Hide
          Freddy Mallet added a comment -

          Manually tested

          Show
          Freddy Mallet added a comment - Manually tested
          Hide
          Evgeny Mandrikov added a comment -

          Integration test added.

          Show
          Evgeny Mandrikov added a comment - Integration test added.

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Freddy Mallet
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: