title: Copy files via Maven plugin when publishing on JBoss
body: <p>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.</p>
  
  <p>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:</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;deploy&lt;/goal&gt;
                              &lt;/goals&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-applet-related-classes&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-resources&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
  
                         &lt;outputDirectory&gt;${basedir}/target/LMS-Admin-Web-  0.0.1/resources/applet&lt;/outputDirectory&gt;
                          &lt;resources&gt;
                              &lt;resource&gt;
                                  &lt;directory&gt;${basedir}/target/classes/de/test/lms/applet&lt;/directory&gt;
                                  &lt;filtering&gt;true&lt;/filtering&gt;
                              &lt;/resource&gt;
                          &lt;/resources&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>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!</p>
  
  <p>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.</p>