You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark McBride <ma...@llnl.gov> on 2003/07/16 19:36:51 UTC

Creating a war file that includes an applet


Our project requires that we have an applet in our web application. 
Following the best practices of maven we decided to place the applet code 
in a separate cvs module since it is a separate artifact from the war we 
build in the main project.

My question is how does one include the applet into the main project in a 
public accessible area of the web application. If I declare it in the 
project.xml when I run "maven war" it will only be loaded in the lib 
directory which won't be accessible from the web page that I want to embed 
the applet in. I'm thinking I might need to write a goal to copy the applet 
jar from the maven local repository at build time???

Any suggestions or pointers are very appreciated!

-Mark

Re: Creating a war file that includes an applet

Posted by Brian Ewins <Br...@btinternet.com>.
In maven.xml

<postGoal name="war:webapp">
   <ant:copy todir="${maven.war.webapp.dir}" 
file="${pom.getDependencyPath('id-goes-here')}"/>
</postGoal>

Since the mechanism in b10 is to build the war from the exploded webapp, 
this should be all you need. In the code above id-goes-here should be 
the id of your artifact - the same as you would use in the <id> element 
when specifying the applet jar as a dependency.

You almost certainly don't want the applet dependency to be marked 
'war.bundle'.

-Baz

Mark McBride wrote:

> 
> 
> Our project requires that we have an applet in our web application. 
> Following the best practices of maven we decided to place the applet 
> code in a separate cvs module since it is a separate artifact from the 
> war we build in the main project.
> 
> My question is how does one include the applet into the main project in 
> a public accessible area of the web application. If I declare it in the 
> project.xml when I run "maven war" it will only be loaded in the lib 
> directory which won't be accessible from the web page that I want to 
> embed the applet in. I'm thinking I might need to write a goal to copy 
> the applet jar from the maven local repository at build time???
> 
> Any suggestions or pointers are very appreciated!
> 
> -Mark
> 


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