|
Re: Cannot find Main class from test classpath [message #1801827 is a reply to message #1801738] |
Mon, 28 January 2019 07:09 |
Till Brychcy Messages: 3 Registered: May 2016 |
Junior Member |
|
|
M2E has implemented test classpath seperation before the concept was added to JDT and it doesn't use this checkbox yet.
It uses a heuristic (see org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.getArtifactScope(ILaunchConfiguration)) :
When JUnit and TestNG Tests are launched, the test scope is used.
When a Java Application is run, it checks if the main class is from a test source folder. If yes, it uses the test scope, otherwise the main scope.
So if your main is in a binary test dependency, this goes wrong.
As workaround, you could create a main method in a test source folder that just delegates to the actual main method you want to launch.
You can help by creating a bug report about this at bugs.eclipse.org (product=m2e, component=jdt)
[Updated on: Mon, 28 January 2019 07:10] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03616 seconds