Now web objects are discovered at build time and then the list of objects is wrote into META-INF/web-types file.
This pose several problems
- need to use maven clean goal when building.
- add apt preprocessor in maven build.
- hard to have hot reload in IDE (requires specialized eclipse builder for example)
- weird problems when testing in eclipse:
- JUnit testing works only if you pout tests in another project - and add as the dependency to your test project the built JAR of the project to test and not a link to the eclipse project.
All these are due of the dynamic discovery (and descriptor generation) of the the web-types at built time.
A fix will be either to add dynamic discovery at runtime, either to explicitly declare web types.
- adding dynamic discovery will add more processing at startup (so more time to start the server)
- using explicit declaration fits with jaxrs Application design - which anyway are used to declare web engine modules.
So I will add an explicit declaration. To declare a WebEngine module you need to extend WebApplication class (which is a specialization of jaxrs Application class) and declare there your webtypes (in the same manner you declare JAX-RS resource roots or providers)
To declare your webtypes extends the getWebTypes method and return an array of web type classes.
See webengine-admin for an example