Maven 1.x Distribution Plugin
  1. Maven 1.x Distribution Plugin
  2. MPDIST-14

making it possible to add config or libs to the dirst

    Details

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

      Description

      the dist plugin only copies docs and jars readme and license
      (and src if creating a src dist). It is not possible to add extra directories to be added to the dist. that's a shame because it makes the dist quite unusable. why not copy everyting?

        Activity

        Hide
        Kees Jongenburger added a comment -

        or a leat make it configurable to add some directories

        Show
        Kees Jongenburger added a comment - or a leat make it configurable to add some directories
        Hide
        Geoffrey De Smet added a comment -

        I agree.

        There should be a basedir/src/dist-resources directory that adds resources to the distribution's generated content (jar's, docs, ...).
        Much in the same way that java resources are added to the generated classes for the jar goal.

        Such distribution resources can be:

        • .bat or .sh files
        • a .ico file used by the shortcuts created by the nsis installer
        • ...

        Currently I had to insert as a postGoal:
        <!-- Icon file needed for installer -->
        <copy todir="$

        {maven.dist.bin.assembly.dir}

        ">
        <fileset dir="$

        {basedir}

        /src/dist-resources">
        <include name="*.ico"/>
        </fileset>
        </copy>

        Show
        Geoffrey De Smet added a comment - I agree. There should be a basedir/src/dist-resources directory that adds resources to the distribution's generated content (jar's, docs, ...). Much in the same way that java resources are added to the generated classes for the jar goal. Such distribution resources can be: .bat or .sh files a .ico file used by the shortcuts created by the nsis installer ... Currently I had to insert as a postGoal: <!-- Icon file needed for installer --> <copy todir="$ {maven.dist.bin.assembly.dir} "> <fileset dir="$ {basedir} /src/dist-resources"> <include name="*.ico"/> </fileset> </copy>
        Hide
        Kees Jongenburger added a comment -

        for the moment I have solved it in a similar manner but since I need the code in multiple project (my project all extend a base project) in the base directory I have added a maven.xml with the following content
        witch also copies the depenencies to a lib directory

        <?xml version="1.0" encoding="UTF-8"?>
        <project xmlns:j="jelly:core" xmlns:deploy="deploy" xmlns:ant="jelly:ant">
        <!-- after the prepare-bin-filesystem also copy libs and config -->
        <postGoal name="dist:prepare-bin-filesystem">
        <j:set var="copyextra.basedir" value="$

        {maven.dist.bin.assembly.dir}

        "/>
        <attainGoal name="copyextra"/>
        </postGoal>
        <!-- after the prepare-src-filesystem also copy libs and config -->
        <postGoal name="dist:prepare-src-filesystem">
        <j:set var="copyextra.basedir" value="$

        {maven.dist.src.assembly.dir}

        "/>
        <attainGoal name="copyextra"/>
        </postGoal>

        <goal name="copyextra">
        <deploy:copy-deps todir="$

        {copyextra.basedir}/lib" excludes="${dist.excludes}"/>
        <ant:copy todir="${copyextra.basedir}

        /config">
        <ant:fileset dir="src/dist-resources">
        <ant:include name="*/"/>
        </ant:fileset>
        </ant:copy>
        </goal>
        </project>

        Show
        Kees Jongenburger added a comment - for the moment I have solved it in a similar manner but since I need the code in multiple project (my project all extend a base project) in the base directory I have added a maven.xml with the following content witch also copies the depenencies to a lib directory <?xml version="1.0" encoding="UTF-8"?> <project xmlns:j="jelly:core" xmlns:deploy="deploy" xmlns:ant="jelly:ant"> <!-- after the prepare-bin-filesystem also copy libs and config --> <postGoal name="dist:prepare-bin-filesystem"> <j:set var="copyextra.basedir" value="$ {maven.dist.bin.assembly.dir} "/> <attainGoal name="copyextra"/> </postGoal> <!-- after the prepare-src-filesystem also copy libs and config --> <postGoal name="dist:prepare-src-filesystem"> <j:set var="copyextra.basedir" value="$ {maven.dist.src.assembly.dir} "/> <attainGoal name="copyextra"/> </postGoal> <goal name="copyextra"> <deploy:copy-deps todir="$ {copyextra.basedir}/lib" excludes="${dist.excludes}"/> <ant:copy todir="${copyextra.basedir} /config"> <ant:fileset dir="src/dist-resources"> <ant:include name="* / "/> </ant:fileset> </ant:copy> </goal> </project>

          People

          • Assignee:
            Lukas Theussl
            Reporter:
            Kees Jongenburger
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: