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

Use <dist.bundle> property of dependencies to include dependencies

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Currently dist doesn't include any dependencies, but most of the time you 'll want to include most of the dependencies.
      This can be done in a ear/war like manner, with a property on the dependencies: <dist.bundle>true</dist.bundle>

        Activity

        Hide
        thierry lach added a comment -

        I've accomplished this with a postGoal against dist:prepare-bin-filesystem. The code could be added directly to the prpare-bin-filesystem goal.

        <postGoal name="dist:prepare-bin-filesystem">
        <!-- Copy in all referenced jars -->
        <j:forEach var="lib" items="$

        {pom.artifacts}

        ">
        <j:set var="dep" value="$

        {lib.dependency}

        "/>
        <j:if test="$

        {dep.getProperty('dist.bundle')=='true'}

        ">
        <ant:copy todir="$

        {pom.getPluginContext('maven-dist-plugin').getVariable('maven.dist.bin.assembly.dir')}

        " file="$

        {lib.path}

        "/>
        </j:if>
        </j:forEach>
        </postGoal>

        Show
        thierry lach added a comment - I've accomplished this with a postGoal against dist:prepare-bin-filesystem. The code could be added directly to the prpare-bin-filesystem goal. <postGoal name="dist:prepare-bin-filesystem"> <!-- Copy in all referenced jars --> <j:forEach var="lib" items="$ {pom.artifacts} "> <j:set var="dep" value="$ {lib.dependency} "/> <j:if test="$ {dep.getProperty('dist.bundle')=='true'} "> <ant:copy todir="$ {pom.getPluginContext('maven-dist-plugin').getVariable('maven.dist.bin.assembly.dir')} " file="$ {lib.path} "/> </j:if> </j:forEach> </postGoal>
        Hide
        Xavier de Labouret added a comment -

        I second this: it is very sad that you have to use a maven.xml to include the dependencies of an application. Using the jar plugin lets you define the JAR dependencies in the classpath in a standard way. The war plugin lets you bundle dependencies. To be consistent, using the dist plugin should let you bundle some or all the dependencies using the project.xml too.

        Without that the work needed to package a standalone app using Maven is heavier, and simply harder for beginners: i believe such a small change would be much appreciated.

        Show
        Xavier de Labouret added a comment - I second this: it is very sad that you have to use a maven.xml to include the dependencies of an application. Using the jar plugin lets you define the JAR dependencies in the classpath in a standard way. The war plugin lets you bundle dependencies. To be consistent, using the dist plugin should let you bundle some or all the dependencies using the project.xml too. Without that the work needed to package a standalone app using Maven is heavier, and simply harder for beginners: i believe such a small change would be much appreciated.
        Hide
        Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          People

          • Assignee:
            Unassigned
            Reporter:
            Geoffrey De Smet
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: