title: Create an "Application Client" with Maven in Java EE
body: <p>I am trying to create a maven based Enterprise Application with an Application Client which runs in the Application Client Container from GlassFish. It should fit togheter as the Project template from Netbeans "Enterprise Application" + "Enterprise Application Client" but with maven and not ant.</p>
  
  
  
  <p>Until now I have following projects </p>
  
  <ul>
  <li>Assembly Maven Project</li>
  <li>EAR-Module</li>
  <li>EJB-Module</li>
  <li>WEB-Module (works well with inside the ear)</li>
  <li>Swing Client Module</li>
  </ul>
  
  <p>The Assembly pom.xml looks like:</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;project xml...
        &lt;modules&gt;
          &lt;module&gt;shop-ear&lt;/module&gt;
          &lt;module&gt;shop-web&lt;/module&gt;
          &lt;module&gt;shop-ejb&lt;/module&gt;
          &lt;module&gt;shop-client&lt;/module&gt;
        &lt;/modules&gt;
      &lt;/project&gt;
  </code></pre>
  
  <p>The ear pom.xml contain</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project ...&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;parent&gt;
      &lt;artifactId&gt;shop&lt;/artifactId&gt;
      &lt;groupId&gt;my.package.name&lt;/groupId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;/parent&gt;
    &lt;groupId&gt;ch.hslu.edu.enapp&lt;/groupId&gt;
    &lt;artifactId&gt;shop-ear&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;ear&lt;/packaging&gt;
    &lt;!-- ... --&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;my.package.name&lt;/groupId&gt;
          &lt;artifactId&gt;shop-ejb&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;type&gt;ejb&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;my.package.name&lt;/groupId&gt;
          &lt;artifactId&gt;shop-web&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;type&gt;war&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;my.package.name&lt;/groupId&gt;
          &lt;artifactId&gt;shop-client&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>And the Swing Client pom.xml contains</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns=....&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;artifactId&gt;shop&lt;/artifactId&gt;
          &lt;groupId&gt;my.package.name&lt;/groupId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;groupId&gt;my.package.name&lt;/groupId&gt;
      &lt;artifactId&gt;shop-client&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;name&gt;shop-client&lt;/name&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;my.package.name.Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
              &lt;id&gt;java.net&lt;/id&gt;
              &lt;layout&gt;default&lt;/layout&gt;
              &lt;name&gt;java.net&lt;/name&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&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;org.jdesktop&lt;/groupId&gt;
              &lt;artifactId&gt;beansbinding&lt;/artifactId&gt;
              &lt;version&gt;1.2.1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Currently I have no dependencies between the Swing Client and the EJB Module. I just want to get a simple Swing form up and running out of the ACC form GlassFish (v 3.1.1).</p>
  
  <p>But this doesn't work. The Swing-Client is packed into the lib folder inside the ear-file and I can not start it.</p>
  
  <p>Do you know a tutorial or example which fulfill this task?</p>