Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-26

New goal to write classpath string with all dependencies from local repo

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0
    • 2.0-alpha-2
    • None
    • None

    Description

      Hi to all,

      'm wondering whether it would be usefull to make a new mojo that when executed it will output a text file containing the required classpath string to run a project directly from the local repository.

      For instance, the file would contain a classpath string like that :

        
          /home/foo/.m2/repository/org/java/utils/util/util-1.0.jar:/home/foo/.m2/ ....
      

      The result file could then be used like that:

        
          java -cp `cat resultFile` MyClass
      

      The new goal should maybe a sub-class of AbstractFromDependenciesMojo.

      In that case, the "useSubDirectoryPerType" and "useSubDirectoryPerArtifact" params should move to (copy/unpack)-dependencies mojo classes. Anyway, these params are only used by sub-classes, so, their definition should be propably inside of those.

      Next are the parameters of the mojo i propose:


      goal name: dependency:printClasspath

      params:

      Param Name Type Description
      outputFile File The file to write the classpath string into.
      overwrite boolean If true, re-write file even when nothing has changed.
      includeTypes String Comma Separated list of Types to include.
      excludeTypes String Comma Separated list of Types to exclude
      includeProjectArtifact boolean see this issue.

      Attachments

        1. MDEP-26_BuildClasspathMojo.java
          8 kB
          Anagnostopoulos Kostis

        Activity

          People

            brianf Brian E Fox
            ankostis Anagnostopoulos Kostis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: