title: How to include tools.jar into uberjar (using maven-shade-plugin)?
body: <p>pom.xml:    </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;test&lt;/groupId&gt;
      &lt;artifactId&gt;test&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun&lt;/groupId&gt;
              &lt;artifactId&gt;tools&lt;/artifactId&gt;
              &lt;version&gt;1.7&lt;/version&gt;
              &lt;scope&gt;system&lt;/scope&gt;
              &lt;systemPath&gt;${java.home}/../lib/tools.jar&lt;/systemPath&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;shade&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;transformers&gt;
                                  &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                                      &lt;mainClass&gt;test.Test&lt;/mainClass&gt;
                                  &lt;/transformer&gt;
                              &lt;/transformers&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><code>mvn install</code> completes successfully, (i.e. maven sees <code>tools.jar</code> dependency during the build), but on execution I have</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/api/JavacScope
      at test.Test.main(Test.java:24)
  Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.api.JavacScope
  ...
  </code></pre>