I have a multi-module project I am trying to better integrate with Eclipse using buildship. Buildship imports the projects just fine and after removing the java plugin from the EAR project, I am able to attempt to deploy my EAR to Websphere (liberty). The deploy never completes because I get NoClassDefFoundError exceptions due to missing Test classes.
I have not done any customization of the source sets for this project at all so all the tests are in src/test/java for each sub project that has tests. The deploy assembleis properties page for all my sub projects do not show these src folders as contributors so I have no clue how these test classes are showing up for deployment when using eclipse.
Is there a configuration step that I am missing that is not done by the eclipse-wtp plugin? I have 1.0.21 of Buildship and gradle 3.3.
this is most probably because the eclipse-wtp plugin includes the default output location (/bin) in the deployment assembly and both main and test sources are compiled into that folder by default. I think you can work around this by changing the output path of the test sourceset:
Thanks, we may have seen the same stack overflow answers. I ran across this same solution as well.
Just to add to this, by putting the above into the build file, eclipse-wtp will configure the org.eclipse.wst.common.component file to include the those /src/test folders as separate wb-resource entries. To prevent the plugin from including your test output directories you need an additional little bit of code:
Makes me wonder if this is something that the eclipse plugins could be doing as everyone whose doing testing and using the default java source sets will need this…