title: Eclipse -> Run as -> Run on server - How to get it to work with JBoss?
body: <p>I use Eclipse Juno and I've made 2 projects:  </p>
  
  <ul>
  <li>One of them is actually a EAR containing an EJB project and a project to hold only the interfaces for the EJBs. I deploy it on the server by going to the:<br>
  <code>EAR Project -&gt; Export -&gt; Java EE -&gt; EAR file</code><br>
  and in the destination box I set the auto-deploy folder of the server (which is JBoss AS 6). Then the project is deployed and the EJBs are initialized.  </li>
  <li>The second project is a simple WAR project depending on the project holding the interfaces. In it I have a dummy servlet calling the EJBs. The procedure of deploying is almost the same. The difference is that I choose <code>WEB -&gt; WAR file</code> in the <code>export</code> navigation menu. After the WAR is deployed everything works fine.  </li>
  </ul>
  
  <p>Now the reason I do the whole "Export" thing is because the <code>Run as -&gt; Run on server</code> does not build and deploy my projects. I thought that is its primary goal. Am I wrong? Is there a way to make this command work as I expected it to? I think it worked this way with Tomcat and web projects...  </p>
  
  <p>I know this could be easily done by build script but that is not my point!</p>
  
  <p>Thanks in advance for your help and suggestions.</p>