title: Deploy web applications to JBoss from Eclipse, with dependencies
body: <p>I have a project developed under Eclipse with JBoss tools installed. When I deploy the application to the Jboss server, some helper jar files which are made available to the project through Maven are not copied inside the WEB-INF/lib folder. Hence, I get a <code>ClassNotFound</code> exception at runtime.</p>
  
  <p>Is there any approach to convince Eclipse (or Maven) to copy the jars into the lib folder at deployment?</p>
  
  <p>EDIT: the pom.xml looks like:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                                     http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.whatever.simulators&lt;/groupId&gt;
  &lt;artifactId&gt;eebuildingsim&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;eebuildingsim Maven Webapp&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  &lt;dependencies&gt;
  
      &lt;!-- begin JBoss --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
          &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
          &lt;version&gt;2.3.2.FINAL&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
          &lt;artifactId&gt;jaxrs-api&lt;/artifactId&gt;
          &lt;version&gt;2.3.0.GA&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.1.2&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- end JBoss --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;ro.mysite&lt;/groupId&gt;
          &lt;artifactId&gt;petrinetexec&lt;/artifactId&gt;
          &lt;version&gt;0.1.3.81&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&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.3&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
          &lt;version&gt;6.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.16&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;version&gt;1.6.6&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;3.8.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.whatever.myAuxiliaryStuff&lt;/groupId&gt;
          &lt;artifactId&gt;myAuxiliaryStuff &lt;/artifactId&gt;
          &lt;version&gt;0.1.0.1305&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
          &lt;version&gt;2.2.0-m09&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
          &lt;version&gt;2.2.0-m09&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;finalName&gt;eebuildingsim&lt;/finalName&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>The artifact <code>myAuxiliaryStuff</code> should be deployed under <code>WEB-INF/lib</code>, under the jboss deployment server.</p>
  
  <p>Using:</p>
  
  <ul>
  <li>Eclipse: Juno Service Release 1</li>
  <li>Jboss: 7.1.1. final</li>
  <li>m2e 1.3.1.20130219-1424</li>
  <li>eclipse web tools platform 3.4.2.v2013</li>
  </ul>
  
  <p>Later edit: the error reported in jboss' log file looks like:</p>
  
  <pre><code> 12:31:38,507 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5)
   JBAS016002: Processing weld deployment mywar.war 12:31:38,522 ERROR
   [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed
   to start service jboss.deployment.unit."mywar.war".POST_MODULE:
   org.jboss.msc.service.StartException in service
   jboss.deployment.unit."mywar.war".POST_MODULE: Failed to process phase
   POST_MODULE of deployment "mywar.war"  at
   org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119)
   [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]  at
   org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
   [jboss-msc-1.0.2.GA.jar:1.0.2.GA]  at
   org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
   [jboss-msc-1.0.2.GA.jar:1.0.2.GA]  at
   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
   [rt.jar:1.7.0_05]  at
   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
   [rt.jar:1.7.0_05]  at java.lang.Thread.run(Thread.java:722)
   [rt.jar:1.7.0_05] Caused by: java.lang.NoSuchFieldError: FLOW  at
   com.sun.faces.flow.FlowDiscoveryCDIExtension.&lt;clinit&gt;(FlowDiscoveryCDIExtension.java:90)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
   Method) [rt.jar:1.7.0_05]  at
   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   [rt.jar:1.7.0_05]  at
   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   [rt.jar:1.7.0_05]  at
   java.lang.reflect.Constructor.newInstance(Constructor.java:525)
   [rt.jar:1.7.0_05]  at
   org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:117)
      at
   org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100)
      at
   org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86)
      at
   org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
   [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]  ... 5 more
  
   12:31:38,522 INFO  [org.jboss.as.server] (DeploymentScanner-threads -
   2) JBAS015870: Deploy of deployment "mywar.war" was rolled back with
   failure message {"JBAS014671: Failed services" =&gt;
   {"jboss.deployment.unit.\"mywar.war\".POST_MODULE" =&gt;
   "org.jboss.msc.service.StartException in service
   jboss.deployment.unit.\"mywar.war\".POST_MODULE: Failed to process
   phase POST_MODULE of deployment \"mywar.war\""}} 12:31:38,647 INFO 
   [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877:
   Stopped deployment mywar.war in 115ms 12:31:38,647 INFO 
   [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774:
   Service status report JBAS014775:    New missing/unsatisfied
   dependencies:
         service jboss.naming.context.java.module.mywar.mywar (missing) dependents: [service
   jboss.naming.context.java.module.mywar.mywar.ValidatorFactory, service
   jboss.naming.context.java.module.mywar.mywar.Validator]  JBAS014777:  
   Services which failed to start:      service
   jboss.deployment.unit."mywar.war".POST_MODULE:
   org.jboss.msc.service.StartException in service
   jboss.deployment.unit."mywar.war".POST_MODULE: Failed to process phase
   POST_MODULE of deployment "mywar.war"
  
   12:31:38,647 ERROR [org.jboss.as.server.deployment.scanner]
   (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation
   failed and was rolled back. Steps that failed:" =&gt; {"Operation step-2"
   =&gt; {"JBAS014671: Failed services" =&gt; {"jboss.deployment.unit.\"mywar.war\".POST_MODULE" =&gt;
   "org.jboss.msc.service.StartException in service
   jboss.deployment.unit.\"mywar.war\".POST_MODULE: Failed to process
   phase POST_MODULE of deployment \"mywar.war\""}}}}
  </code></pre>