title: Create executable JAR from Groovy script
body: <p>I have a maven project which consist of 1 groovy script <strong>(src/main/groovy/Main.groovy</strong>)</p>
  
  <p>I am able to run it from IntelliJ by simply clicking run. What I want to do is to create an executable jar containing all dependencies so I could run in with</p>
  
  <pre><code>java -jar myjar.jar
  </code></pre>
  
  <p>Here's my pom:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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;groupId&lt;/groupId&gt;
  &lt;artifactId&gt;artifactId&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;6.0.6&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I've searched on google and on so but couldn't find any working solution.</p>