maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michał Stochmiałek <michal.stochmia...@eurobank.pl>
Subject RE: [m2] run plugin after webapp is assembled and before it's zipped
Date Thu, 29 Dec 2005 12:06:48 GMT
> Hi Ralph,
> 
> > I'd like to post-process my JSPs using the antrun plugin (which uses
> > ant's replaceregexp task). The plugin execution itself works fine,
> > but now I need it to run after the webapp is assembled and before
> > it's zipped up as a warfile.
> 
> I had do dig around in the maven-war-plugin myself and I'm pretty sure
> that the maven-war-plugin currently does not support what you want. The
> webapp will be assembled in an uncompressed folder structure first,
> afterwards it's compressed. If you need to put some code in between those
> two steps, you might also be forced to hack around in the war plugin :-(

I had similar problem. As I remember I modified contents of "target/${finalname}" directory
using several ant tasks in antrun plugin. After that I _updated_ "target/${finalname}.war"
using war ant tasks (also in the same antrun). 

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
  <execution>
    <phase>package</phase>
    <configuration>
      <tasks>
        <!-- do something in "${project.build.directory}/${project.build.finalName}" -->

        <ear destfile="${project.build.directory}/${project.build.finalName}.ear" appxml="${project.build.directory}/${project.build.finalName}/META-INF/application.xml">
          <!-- if you can attach a fileset -->
          <fileset dir="${project.build.directory}/${project.build.finalName}" includes="**/*.jsp"/>
        </ear>
      </tasks>
    </configuration>
    <goals>
      <goal>run</goal>
    </goals>
  </execution>
</executions>
</plugin>

I think this is the fastest way to archive what you want.


btw. you can't use property for  "${project.build.directory}/${project.build.finalName}",
since http://jira.codehaus.org/browse/MANTRUN-29.

best regards,
--
Michal Stochmialek
IT Department, Technology Division
Euro Bank S.A.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message