Announcement Announcement Module
Collapse
No announcement yet.
Referencing two projects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Referencing two projects

    Friends, I want to do the following:

    1. - Project Spring Roo .-only to obtain information ususarios, profiles and master tables of my database, apart from some generic functions that I can use on various projects.

    2. - Project Spring Roo .- for every need (Logistics System, Document Processing System, etc)



    Do I need a referral from my Project No. 1 in my project developed No. 2. What I do is create a. Jar of my project developed No. 1 and add it to my Project No. 2 (by adding it to my maven repository), but I get an error, does not recognize the entities nor the queries of my project No. 2, I think that I have two projects in the configuration files (ApplicationContext) and persistence files (persistence.xml).



    HELP.

    As I have to set both projects to work.??

  • #2
    The best approach is to use the new feature maven multi-module, from Spring Roo 1.2.

    The best way is to create modules for the master tables (just in case you want to separate some kind of business logic: administration, mapping of codes and so on) and a web module for the main business logic (Logistics or whatever)

    In the web project you will use the main business logics (coded in the Entities/Services) and the logic imported from the depending projects.

    In response to your question, you have to add the appropriate dependencies in the web project's pom AND install ("mvn clean install") these projects (modules)

    If you need more help, maybe you can provide some script to see what we're talking about.

    Regards.

    Comment


    • #3
      my dear friend.

      1. - For Project No. 1 I want to generate a 'jar'
      2. - This file 'jar' I want to add to Project No. 2, Project No. 3, Project No. 4.


      Project No. 1
      --src/main/java /
      - eg. gob.mpfn.domain
      - MaestroUsuario. Java
      - MaestroPerfil. Java
      .
      .
      .
      --src/main/resources /
      META-INF /
      spring /
      applicationContext.xml
      database.properties
      persistence.xml
      .
      .
      .
      The Project No. 1 I generate a 'jar'


      Project No. 2
      --src/main/java /
      - eg. gob.mpfn.SistemaTramiteDocumentario.domain
      - Document. Java
      - MovimientoDocumento. Java
      .
      .
      .
      --src/main/resources /
      META-INF /
      spring /
      applicationContext.xml
      database.properties
      persistence.xml
      .
      .
      .
      src /
      main /
      webapp /
      META-INF /
      WEB-INF /
      spring /
      app-servlet.xml
      layouts /
      views /
      *. jpsx
      .
      .
      .
      pom.xml
      <dependecy>
      <groupId>pe.gob.mpfn</groupId>
      <artifactId>Proyecto1</artifactId>
      <version>1.0</version>
      <type>jar</type>
      <scope>compile</scope>
      </dependency>


      The idea is to have several projects working with other programmers.

      I need an example. my email is [email protected]

      Thanks.

      Comment


      • #4
        Try somethibg like:

        Code:
        Project --topLevelPackage gob.mpfn --projectName proyecto-parent
        module create --moduleName proyecto-maestros --topLevelPackage ~.maestros
        module focus --moduleName ~
        module create --moduleName proyecto-std --topLevelPackage ~.std
        module focus --moduleName proyecto-maestros
        jpa setup ...
        entity jpa...
        ...
        
        module focus --moduleName proyecto-std
        jpa setup ...
        entity jpa...
        ...
        web mvc setup...
        //Create controllers
        The modules are self-contained, so you can share in a code repository like GIT and work in them separately.

        Once the job is done, you can add the dependency (in the pom or using the roo command), install (with maven) the first module, and continue with the development.

        Use tab in the shell or ctrl-space STS for code completion when you want to create contollers in your web modules for entities in your "master" modules because the character for refering an external module is '|' (without quites) and it's easier to follow the suggestions made by Roo.

        I hope it helps you.

        Regards.

        P.S.: try to create the project and share the script if you have any problems.

        Comment

        Working...
        X