Maven Invoker Plugin
  1. Maven Invoker Plugin
  2. MINVOKER-63

Inject some Verifier-like component into the scripts to ease common assertions

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Auto Closed
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Labels:
      None

      Description

      Many pre-/post-build hook scripts share very similar patterns to check for existence/absence of files, JAR entries etc. Those scripts could be greatly condensed if the Invoker Plugin provided a Verifier-like component to perform these common assertions using dedicated methods. In detail, offer Verifier.assert*() for the scripts.

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          2547d 10h 5m 1 Michael Osipov 06/Sep/15 20:44
          Michael Osipov made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Auto Closed [ 10000 ]
          Hide
          Michael Osipov added a comment -

          This issue has been auto closed because it has been inactive for a long period of time. If you think this issue still applies, retest your problem with the most recent version of Maven and the affected component, reopen and post your results.

          Show
          Michael Osipov added a comment - This issue has been auto closed because it has been inactive for a long period of time. If you think this issue still applies, retest your problem with the most recent version of Maven and the affected component, reopen and post your results.
          Mark Thomas made changes -
          Workflow jira [ 12959254 ] Default workflow, editable Closed status [ 12996116 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 00:02:09 UTC 2015 [ 1428278529346 ]
          Mark Thomas made changes -
          Workflow jira [ 12721774 ] Default workflow, editable Closed status [ 12762015 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 10:28:53 UTC 2015 [ 1428229733495 ]
          luke w patterson made changes -
          Field Original Value New Value
          Link This issue relates to MINVOKER-113 [ MINVOKER-113 ]
          Hide
          Benjamin Bentmann added a comment -

          Not sure whether we need those. I currently have a simple/lightweight POJO class in mind (i.e. not a component in the Plexus sense) that just has some constructors for initialization and that's it. The dispose() is intended to release resources like file handles on archives. However, it's not fully thought up (at least on my side ).

          To further illustrate the intended usage:

          In the Invoker Plugin
          // setup the asserter for the current IT
          Asserter asserter = new Asserter();
          asserter.setCurrentDirectory( basedir );
          
          // pass it on to the script interpreter as a global variable
          runHookScript( ..., asserter );
          
          // tidy up
          asserter.dispose();
          
          In the Hook Script
          asserter.assertFile( "target/foo-1.0.jar" );
          asserter.setCurrentDirectory( "target/exploded" );
          asserter.assertFile( "WEB-INF/lib/bar-1.0.jar" );
          
          Show
          Benjamin Bentmann added a comment - Not sure whether we need those. I currently have a simple/lightweight POJO class in mind (i.e. not a component in the Plexus sense) that just has some constructors for initialization and that's it. The dispose() is intended to release resources like file handles on archives. However, it's not fully thought up (at least on my side ). To further illustrate the intended usage: In the Invoker Plugin // setup the asserter for the current IT Asserter asserter = new Asserter(); asserter.setCurrentDirectory( basedir ); // pass it on to the script interpreter as a global variable runHookScript( ..., asserter ); // tidy up asserter.dispose(); In the Hook Script asserter.assertFile( "target/foo-1.0.jar" ); asserter.setCurrentDirectory( "target/exploded" ); asserter.assertFile( "WEB-INF/lib/bar-1.0.jar" );
          Hide
          Olivier Lamy (*$^¨%`£) added a comment -

          setup() or initialiaze() in first ?

          Show
          Olivier Lamy (*$^¨%`£) added a comment - setup() or initialiaze() in first ?
          Hide
          Benjamin Bentmann added a comment -

          Some first thoughts on the API of this Asserter component:

          • setCurrentDirectory(String/File path)
          • assertFile(String/File path)
          • assertDirectory(String/File path)
          • assertNotPath(String/File path)
          • assertNotPaths(String includes, String excludes)
          • assertFileContents(String/File path, String encoding, String regex)
          • setCurrentArchive(String/File path)
          • assertArchiveEntry(String path)
          • assertNotArchiveEntry(String path)
          • assertNotArchiveEntries(String includes, String excludes)
          • assertArchiveEntryContents(String path, String encoding, String regex)
          • dispose()

          The archive assertions should be reviewed to support nested archives.

          Show
          Benjamin Bentmann added a comment - Some first thoughts on the API of this Asserter component: setCurrentDirectory(String/File path) assertFile(String/File path) assertDirectory(String/File path) assertNotPath(String/File path) assertNotPaths(String includes, String excludes) assertFileContents(String/File path, String encoding, String regex) setCurrentArchive(String/File path) assertArchiveEntry(String path) assertNotArchiveEntry(String path) assertNotArchiveEntries(String includes, String excludes) assertArchiveEntryContents(String path, String encoding, String regex) dispose() The archive assertions should be reviewed to support nested archives.
          Benjamin Bentmann created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Benjamin Bentmann
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development