0

I'm fairly unexperienced and all new to the whole world of build tools so here's my situation: I am developing a webapp with JSF, PrimeFaces and Hibernate on wildfly-9.0.2-final. All java files (incl. ManagedBeans, DAOs, Model classes, etc.) are currently in a regular eclipse java project called MyApp-CORE. There is no html or any other resources in that project, but all the third-party libraries like PrimeFaces, commons-xy, etc. Then I got two dynamic web projects with all the .xhtml files and stuff. Both web projects include the CORE in their build path (all done via eclipse built-in tools). Basically I followed Structure for multiple JSF projects with shared code so far. All projects are versioned using Git. I was now asking myself how to mavenize the whole thing and also how to properly include tests. The final result should be:

  1. I want a build file for each web project that includes the CORE dependency and all of it's transitive dependencies, creates a .war file and deploys it either on the production system or locally (Depending on some parameters I want to be able to maintain).
  2. This buildfile could then for instance test and build the CORE and then the .war file.
  3. Since I'm using JSF, mostly the only option for testing is JSFUnit. Should I test each web project individually and put all the test cases there (which would be highly redundant because they're mostly the same, just a few features are different) or should I rather create a separate web project called MyApp-TEST which tests the CORE.jar and also - depending on some configuration - each web project.

I've already created a structure that makes it possible to include the core in the web project but unfortunately I loose the perks of hot deployment in wildfly when just including it as a dependency from my local maven repository. So, to summarize it:

  • What would be a best practice for this setup, eventually leading to a continuous integration scenario?
  • How should I include the test cases (full integration tests that test actual UI behaviour)?
  • Which Tool (Maven, Gradle, Ant, etc.) would be best for that task?
  • Keep using hot deployment for smooth development?

Thanks in advance for any comments, hints or shared experience!

Community
  • 1
  • 1
Jonas Bausch
  • 185
  • 3
  • 12
  • It really doesn't matter which of Maven or Gradle you use...but you need to decouple your modules, cause you have DAO's etc. which should be a separate module and which can also being tested separately...(unit tests incl. Mocks etc.). One important question I would like to ask. Should all those projects released together ? If yes you should make a multi module build in Maven or a Multi Project in Gradle...Apart from that unit tests belong to their appropriate module where the production code is located `src/main/java` and the test code in `src/test/java`etc... – khmarbaise Dec 31 '16 at 11:44
  • ok, so I've decoupled them now, resulting in the following structure: MyApp-PERSISTENCE includes dao, daoImpl and model, MyApp-CORE contains all the beans and filters and whatnot and MyApp-A and MyApp-B contain the web resources. MyApp-A and B include the MyApp-CORE.jar and MyApp-CORE includes MyApp-PERSISTENCE.jar. I don't exactly know what you mean by "should they be released together?" but basically MyApp-A and MyApp-B are getting released independently. – Jonas Bausch Dec 31 '16 at 18:38

0 Answers0