title: How to build a standalone SWT GUI with Maven?
body: <p>In this howto <a href="https://www.eclipse.org/swt/eclipse.php" rel="nofollow noreferrer">https://www.eclipse.org/swt/eclipse.php</a> there is a good guide how to build an SWT based GUI with Eclipse.
  Now, I want to assemble the same project with Maven. By using the pom.xml  at the end, I get the following error: </p>
  
  <pre><code>[DEBUG] adding entry libswt-awt-cocoa-4626.jnilib
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.747 s
  [INFO] Finished at: 2017-08-12T15:06:45+02:00
  [INFO] Final Memory: 15M/225M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project swtsandbox: Failed to create assembly: Error creating assembly archive jar-with-dependencies: Problem creating jar: invalid LOC header (bad signature) -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project swtsandbox: Failed to create assembly: Error creating assembly archive jar-with-dependencies: Problem creating jar: invalid LOC header (bad signature)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
  </code></pre>
  
  <p>The pom.xml</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/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;pmu&lt;/groupId&gt;
    &lt;artifactId&gt;swtsandbox&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;swtsandbox&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;swt.version&gt;4.6.1&lt;/swt.version&gt;
    &lt;/properties&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;maven-eclipse-repo&lt;/id&gt;
          &lt;url&gt;http://maven-eclipse.github.io/maven&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&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;!-- select prefered one, or move the preferred on to the top: --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.swt&lt;/groupId&gt;
              &lt;artifactId&gt;org.eclipse.swt.gtk.linux.x86_64&lt;/artifactId&gt;
              &lt;version&gt;${swt.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.swt&lt;/groupId&gt;
              &lt;artifactId&gt;org.eclipse.swt.cocoa.macosx.x86_64&lt;/artifactId&gt;
              &lt;version&gt;${swt.version}&lt;/version&gt;
          &lt;/dependency&gt;
    &lt;/dependencies&gt;
  
  
  
  &lt;build&gt;
      &lt;pluginManagement&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;3.6.2&lt;/version&gt;
            &lt;configuration&gt;
              &lt;!-- put your configurations here --&gt;
            &lt;/configuration&gt;
          &lt;/plugin&gt;
  
  &lt;plugin&gt;
    &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
    &lt;configuration&gt;
      &lt;archive&gt;
        &lt;manifest&gt;
          &lt;mainClass&gt;pmu.swtsandbox.App&lt;/mainClass&gt;
        &lt;/manifest&gt;
      &lt;/archive&gt;
      &lt;descriptorRefs&gt;
        &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
      &lt;/descriptorRefs&gt;
    &lt;/configuration&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;id&gt;make-assembly&lt;/id&gt; &lt;!-- this is used for inheritance merges --&gt;
        &lt;phase&gt;package&lt;/phase&gt; &lt;!-- bind to the packaging phase --&gt;
        &lt;goals&gt;
          &lt;goal&gt;single&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;
  
        &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Maven version:</p>
  
  <pre><code>Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
  Maven home: /usr/local/apache-maven-3.3.9
  Java version: 1.8.0_101, vendor: Oracle Corporation
  Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "mac os x", version: "10.11.4", arch: "x86_64", family: "mac"
  p
  </code></pre>