How to add source files generated in target folder as library in Intellij Idea
<p>I'm trying to checkout a maven project from SubVersion. In the pom.xml file it's specified to generate web service proxy classes in the target folder. Here's the concerned part of the pom.xml file:</p>

<pre><code>          &lt;execution&gt;
                &lt;goals&gt;
                    &lt;goal&gt;wsimport&lt;/goal&gt;
                &lt;/goals&gt;
                &lt;configuration&gt;

                    &lt;wsdlUrls&gt;                               
                        &lt;wsdlUrl&gt;${basedir}/config/mnpBusinessService.wsdl&lt;/wsdlUrl&gt;
                    &lt;/wsdlUrls&gt;

                    &lt;packageName&gt;com.mnp.services.business&lt;/packageName&gt;
                    &lt;sourceDestDir&gt;${basedir}/target/generated-code/src&lt;/sourceDestDir&gt;
                &lt;/configuration&gt;
                &lt;id&gt;ws-import-mnpBusinessService&lt;/id&gt;
                &lt;phase&gt;generate-sources&lt;/phase&gt;
           &lt;/execution&gt;
</code></pre>

<p>As you can see the maven is instructed to create the generated proxy classes in the <code>${basedir}/target/generated-code/src</code> directory. When I checkout with NetBeans, a seperate GeneratedCode directory is created as part of the project. And any package inside this directory is available to the main source files. But when I checkout with Intellij Idea,</p>

<ol>
<li><p>I have to manually execute install command and second.</p></li>
<li><p>The files are indeed created in the specified directory but main source files can't see those packages.</p></li>
</ol>

<p>I've tried Project Structure|Modules|MyModule|Dependencies|Add Jars or directories and Project Structure|Libraries|Add|Java|Mydiectoryy. But neither helped. I also tried removing the <code>target</code> folder from Exclude list but that didn't help either. What should I do to be able to import generated proxy classes in Intellij Idea. It's the Ultimate version 2016.2.4. </p>