[ http://jira.codehaus.org/browse/MPWAR-30?page=comments#action_38343 ]
     
fabrizio giustina commented on MPWAR-30:
----------------------------------------

Hi Felipe,
the jar:jar goal can be added as a prereqs for a specific goal, only used when 
maven.war.usesJar is set. Since jar will only be called if this property is set 
it will not executed if the project doesn't have any java file.

This is the goal using a prereqs:

    <j:choose>
      <j:when test="${!usesJar}">
        <util:available file="${maven.build.dest}">
                <ant:copy todir="${webapp.build.classes}">
                <ant:fileset dir="${maven.build.dest}"
                        includes="${maven.war.classes.includes}"
                        excludes="${maven.war.classes.excludes}">
                </ant:fileset>
                </ant:copy>
        </util:available>
      </j:when>
      <j:otherwise>
        <attainGoal name="war:webapp-using-jar"/>
      </j:otherwise>
    </j:choose>
  </goal>

  <goal name="war:webapp-using-jar" 
prereqs="war:war-resources,test:test,jar:jar"
    description="Internal goal called when maven.war.usesJar is set">
    <ant:copy todir="${webapp.build.lib}" 
file="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.jar"/>
  </goal>

> [PATCH] Option to pack project classes inside a JAR into WEB-INF/lib
> --------------------------------------------------------------------
>
>          Key: MPWAR-30
>          URL: http://jira.codehaus.org/browse/MPWAR-30
>      Project: maven-war-plugin
>         Type: New Feature
>     Versions: 1.7
>     Reporter: Felipe Leme
>     Assignee: Felipe Leme
>  Attachments: maven_war_usesJar.patch
>
> Original Estimate: 1 hour
>         Remaining: 1 hour
>
> The way the plugin works now, the project classes are packed under 
> WEB-INF/classes. It would be nice if the plugin used the project's JAR 
> instead, packing it under WEB-INF/lib. That feature would be really useful 
> when the war is a secondary package for the project (for instance, when the 
> main artifact is a JAR containg a taglib).
> I'm providing a patch for this change - if there is interest in applying it, 
> I can write some test cases too.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to