[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ project-with-launch-configs ---
[INFO] Building jar: /home/karypid/d/wc.git/git.eclipse.org/m2e/548948_test_scope_jdt_setting/project-with-launch-configs/target/project-with-launch-configs-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (main-class-in-regular-with-test-scope) @ project-with-launch-configs ---
LaunchRegularMain loading main.sources.LaunchRegularMain: OK!
LaunchRegularMain loading test.sources.LaunchTestMain: OK!
LaunchRegularMain loading main.sources.DepRegularMain: OK!
LaunchRegularMain loading test.sources.DepTestMain: OK!
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (main-class-in-regular-with-runtime-scope) @ project-with-launch-configs ---
LaunchRegularMain loading main.sources.LaunchRegularMain: OK!
LaunchRegularMain loading test.sources.LaunchTestMain: NOOOOOOOOOOOOOOO :-(
LaunchRegularMain loading main.sources.DepRegularMain: OK!
LaunchRegularMain loading test.sources.DepTestMain: NOOOOOOOOOOOOOOO :-(
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (main-class-in-test-with-test-scope) @ project-with-launch-configs ---
LaunchTestMain loading main.sources.LaunchRegularMain: OK!
LaunchTestMain loading test.sources.LaunchTestMain: OK!
LaunchTestMain loading main.sources.DepRegularMain: OK!
LaunchTestMain loading test.sources.DepTestMain: OK!
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (main-class-in-test-with-runtime-scope) @ project-with-launch-configs ---
Error: Could not find or load main class test.sources.LaunchTestMain
Caused by: java.lang.ClassNotFoundException: test.sources.LaunchTestMain
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for 548948_test_scope_jdt_setting 0.0.1-SNAPSHOT:
[INFO]
[INFO] 548948_test_scope_jdt_setting ...................... SUCCESS [ 0.008 s]
[INFO] project-with-shared-test-code ...................... SUCCESS [ 1.231 s]
[INFO] project-with-shared-runtime-code ................... SUCCESS [ 0.062 s]
[INFO] project-with-launch-configs ........................ SUCCESS [ 1.070 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
...
There are 4 launch configuration that replicate the maven-exec-plugin stuff inside the pom.xml:
If you import the test project into your Eclipse using the currently released M2E 1.15 and then try the launch configurations you will see that they do not behave according to JDT classpath settings. Instead they use the 'heuristic' getArtifactScope() to populate the classpath giving different results.