You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Max Cooper <ma...@maxcooper.com> on 2006/04/27 02:40:26 UTC

Re: Applets

You need a multi-project.

I have not setup a maven2 project to build an applet that is deployed as 
part of a webapp, so take my advice with a grain of salt.

I would think that you would first need to have a subproject to build a 
jar file that contains your applet. The applet code should probably be 
separate from your webapp code anyway. Any code that is shared by the 
webapp and the applet should be moved to third "shared jar" project that 
both the webapp and applet project will depend on.

The next challenge is then to get the applet jar file into the your war 
as "content" (rather than getting it into WEB-INF/lib, as would happen 
with a dependency). I have a few different ideas about how you might do 
that (most of which probably won't work):
* The latest not-yet-released-but-already-in-svn version of the 
maven-war-plugin supports resources, which may allow you to specify the 
path to the applet jar in the local repository as a resource to include 
(as web content) in the war.
* Antoher option would be to write your own plugin to grab the 
applet.jar and stick it in ${webappDirectory} during the build.
* Perhaps you can write a little Ant script to grab the applet.jar and 
put it in ${webappDirectory}, and then use the maven-antrun-plugin to 
execute your Ant script.
* There are some plugins that "merge" war files. Perhaps your applet 
subproject could be configured/perverted into putting the compiled class 
files into a "web content" location (not under WEB-INF), and then the 
applet war could be merged with your main webapp war file.

The general use case of needing to build an applet that is then included 
as part of a webapp does seem like a "standard" use case (as opposed to 
something "wacky"), so perhaps there will be some features added to the 
war plugin to support it.

-Max

Les.Olinger@SunGard.com wrote:
> I have a large web application that currently uses maven 1.02 to build. I 
> have a need to add an applet to the application. I am having issues with 
> visibility of the class file from the html page because the default 
> src/main/java/...... gets built into the webapp/WEB-INF/classes when using 
> maven for the build. Is there any documentaion or examples of how to build 
> applets into a web application. 
> Can I change the target for just the applet classes?
> Do I need to create a multi-project?
> 
> Any guidence would be appreciated.
> 
> Les Olinger ? Product Lead ? SunGard ? Omni ? 104 Inverness Center Place, 
> Birmingham, AL 35242
> Tel 205-437-7820 ? Fax 205-437-7838 ? www.sungard.com/omni
> 
> 

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