Import only one dependency in Java Maven project
<p>I need to make a jar out of my Java project, and I need it to also contain the class files of one of the dependencies, but not all of them. I've used <code>maven-assembly-plugin</code> which includes all the files and creates a huge jar, but I only need</p>

<pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
    &lt;artifactId&gt;aws-java-sdk&lt;/artifactId&gt;
    &lt;version&gt;1.10.45&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>

<p>I've also tried the maven shade plugin but with no result: I somehow end up including all the dependencies or excluding all of them</p>

<pre><code>&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.4.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;artifactSet&gt;
                    &lt;excludes&gt;
                        &lt;exclude&gt;org.apache.spark:*&lt;/exclude&gt;
                        &lt;exclude&gt;com.google.code.gson:*&lt;/exclude&gt;
                        &lt;exclude&gt;edu.stanford.nlp:*&lt;/exclude&gt;
                        &lt;exclude&gt;log4j:*&lt;/exclude&gt;
                        &lt;exclude&gt;com.optimaize.languagedetector:*&lt;/exclude&gt;
                        &lt;exclude&gt;info.debatty:*&lt;/exclude&gt;
                    &lt;/excludes&gt;
                &lt;/artifactSet&gt;
            &lt;/configuration&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
&lt;/plugin&gt;
</code></pre>