unit test with Reflections finds nothing?

Reflections in my unit test return nothing.

public static void main(String[] args) {
  var reflections = new Reflections("com.marginallyclever.ro3");
  var allClasses = reflections.getSubTypesOf(JPanel.class);  // list not empty
}

However,

@Test public void myTest() {
  var reflections = new Reflections("com.marginallyclever.ro3");
  var allClasses = reflections.getSubTypesOf(JPanel.class);  // list empty
}

I'm using Maven with the latest in reflections, surefire, and jupiter.

When I print the classpath I notice that ${project.basedir}/target/classes is missing.  I tried a few ways to add it manually at the pom level.  Copilot and ChatGPT offered the same things I'd already tried.

Please!  What am I missing?

0

Please sign in to leave a comment.