0 Replies Latest reply on Jan 24, 2017 5:01 PM by Daniel Korbel

    Errai strange package definitions: *.client.local, *.client.shared, *.server

    Daniel Korbel Newbie

      I've found in official docs required structure of errai project like follow:

      project

      • src
        • main
          • java
            • com.mycompany.myapp
              • MyApp.gwt.xml [the app's GWT module]
            • com.mycompany.myapp.client.local
              • MyAppClientStuff.java [code that @Injects Caller<MyAppRestResource>]

            • com.mycompany.myapp.client.shared
              • CustomerService.java [the JAX-RS interface]

            • com.mycompany.myapp.server
              • CustomerServiceImpl.java [the server-side JAX-RS resource implementation]

      Can anyone explain to me the strange package structure of errai projects?

      Why there is such structure? Why errai doesn't follow vanilla gwt structure:

      com.mycompany.myapp.client
      com.mycompany.myapp.shared
      com.mycompany.myapp.server?
      
      

      It is really hard for me to understand that. If shared package contains content shared between server and client- why it is putted in client package?

      Why there is shuch package like:

      com.mycompany.myapp.client.local
      

       

      Currently I use vanilla gwt structure. Is this the reason why my jax-rs services return 404?

       

      How to deal with this structure when I wonna design maven multimodule project, where I would like to have:

      main module/parent

      • client
      • server
      • shared

      each one with separete pom.xml, but built together by parent module? This is the common approach for maven projects.

      Should I have shared package twice? One in client maven module in client.shared package, and the second in shared maven module?

       

      Please help me to figure this out.

      If my question is confusing, give me feedback, I will try to explain it much more.

      Thanks in advance for Your help.

       

      I am newbie in errai world and I would like to start it with the best common practices.