I want to run a Java-Applet. I use a JBoss Server. I use Maven. I use Eclipse. I deploy my Web-Archive inside an Enterprise Archive onto the Server by using Eclipse.
For the Applet I need the Applet's .class-file in an accessible folder for the applet.html. My idea was to copy the .class-from the target-folder to the resources-folder of my Web-Archive. So I added following plugin to the pom.xml of the Web-Maven-Project:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
<goals>
<goal>deploy</goal>
</goals>
<executions>
<execution>
<id>copy-applet-related-classes</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/LMS-Admin-Web- 0.0.1/resources/applet</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target/classes/de/test/lms/applet</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
I think I'm messing up the phase and the goal. It worked once when I had the goal "install" for the package and executed "mvn clean install" inside my project-folder. The problem is when I use right-click->publish in Eclipse. I don't know, what goals are run than. I tried a lot around, but it doesn't apply in the JBoss' standalone/deployments/... file-system. Turns out this is also really hard to google. So I'd be thankful for any ideas, links or other help!
EDIT: I found out, that the classes-folder in the target-folder is edited when I publish, but the WEB-Folder which is packaged to the WAR-File isn't. Maybe I need a phase, which is before packaging? I'm to investigate further tomorrow.