title: Unable to find classes using org.reflections.Reflections from inside custom Maven plugin
body: <p>I have created a custom Maven plugin like so:</p>
  <pre><code>@Mojo(name=&quot;generate&quot;, defaultPhase = LifecyclePhase.PREPARE_PACKAGE) 
  public class HandlerGeneratorMojo extends AbstractMojo {
  ...
  }
  </code></pre>
  <p>And I am using it like this:</p>
  <pre><code>            &lt;!-- GENERATE EVENT HANDLERS (POC) --&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;handler-generator-maven-plugin&lt;/artifactId&gt;
              &lt;groupId&gt;my.group.id&lt;/groupId&gt;
              &lt;version&gt;${revision}&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;generate handlers&lt;/id&gt;
                      &lt;phase&gt;prepare-package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;generate&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                      ...
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  <p>In the execute method of the Mojo I am trying to retrieve all interfaces that extend interface CdsData, using the Reflections api.</p>
  <pre><code>        final Reflections reflections = new Reflections();
      
       final Set&lt;Class&lt;? extends CdsData&gt;&gt; allClasses = 
           reflections.getSubTypesOf(CdsData.class);
  
       log.info(&quot;Number of results: &quot; + allClasses.size());
       
       for (final Class&lt;? extends CdsData&gt; cdsDataClass: allClasses) {
  
           log.info(&quot;Result: &quot; + cdsDataClass);
       }
  </code></pre>
  <p>I get five results, that are in a dependency of the pom where I execute the plugin. So that is ok.
  However I have also generated some implementations using another plugin (cds4j-maven-plugin) that has set</p>
  <pre><code>&lt;phase&gt;generate-sources&lt;/phase&gt;
  </code></pre>
  <p>And I have tried to set the phase of my custom plugin to prepare-package so it is executed way after the above plugin has generated the sources.
  However I get no more results than the five I mentioned before. I would expect to see those generated interfaces as well.</p>
  <p>Might this be a class path, or class loader problem? Or the phases maybe?</p>
  <p>I have also tried to put the package of the generated classes in the Reflections constructor, and I have tried to configure Reflections class loading as described here at line 8: <a href="https://www.hellojava.com/a/80798.html" rel="nofollow noreferrer">https://www.hellojava.com/a/80798.html</a></p>
  <p>Any help is appreciated! Thank you!</p>
  <p>Cheers,
  Kjeld</p>