AppFuse
  1. AppFuse
  2. APF-1012

Extend appfuse maven plugin to allow sub-packages

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1.0
    • Component/s: Tools - AMP
    • Labels:
      None
    • Environment:
      all

      Description

      Using AMP with sub-packages is an essential thing. So I checked out AMP from svn repository and made a quick (and dirty ?) improvement to be aware of subpackages.
      I didn't test it very much, just made the modification in AppFuseGeneratorMojo and tryied it in a "core" and "web" project and it worked.

      It was a really small modification, I think it can be integrated easily (well the hard part is testing, isn't it ?).

      The modified class is in attachment.

      1. APF-1012.patch
        2 kB
        Edouard Laroche-Joubert
      2. APF-1012.patch
        2 kB
        Edouard Laroche-Joubert
      3. AppFuseGeneratorMojo.java
        14 kB
        Edouard Laroche-Joubert

        Activity

        Hide
        Matt Raible added a comment -

        Thanks for the patch! Is it possible to attach a diff instead of the whole file? Use "svn diff > APF-1012.patch" to create it.

        Show
        Matt Raible added a comment - Thanks for the patch! Is it possible to attach a diff instead of the whole file? Use "svn diff > APF-1012 .patch" to create it.
        Hide
        Edouard Laroche-Joubert added a comment -

        Yep sorry, actually I've found a bug in the "web" part module (because of the "if ... war ..." part I think). It's not a big thing, it generates two Action class (and jsp as well): one in the sub package, and an other one in the main package.
        Maybe it indicates that it was generating the files twice.
        I'll look at this, correct it and send the diff

        happy to help.

        Show
        Edouard Laroche-Joubert added a comment - Yep sorry, actually I've found a bug in the "web" part module (because of the "if ... war ..." part I think). It's not a big thing, it generates two Action class (and jsp as well): one in the sub package, and an other one in the main package. Maybe it indicates that it was generating the files twice. I'll look at this, correct it and send the diff happy to help.
        Hide
        Edouard Laroche-Joubert added a comment -

        Still got the Action bug (two generations) but it's a start.

        Show
        Edouard Laroche-Joubert added a comment - Still got the Action bug (two generations) but it's a start.
        Hide
        Edouard Laroche-Joubert added a comment -

        sorry the previous one was wrong.

        Show
        Edouard Laroche-Joubert added a comment - sorry the previous one was wrong.
        Hide
        Matt Raible added a comment -

        I don't see how this patch helps anything. Do you have to set additional configuration properties in your pom.xml for this to work?

        Show
        Matt Raible added a comment - I don't see how this patch helps anything. Do you have to set additional configuration properties in your pom.xml for this to work?
        Hide
        Edouard Laroche-Joubert added a comment -

        Hi Matt,

        well when you want your code to be generated you use: mvn appfuse:gen -Dentity=Person

        that works fine, it generates it in org.appfuse.model.Person, org.appfuse.dao.PersonDao etc.... But what about having a package in between for example : org.appfuse.salary.model.Person, org.appfuse.dao.PersonDao, etc..
        You have to refactor all the classes, check the xml files etc...

        here you use: mvn appfuse:gen -Dentity=Person -DfullPath=org.appfuse.salary.model
        (or something like that, I forgot a bit about, I did it the 4th of february sorry).

        and it generates : org.appfuse.salary.model.Person, org.appfuse.salary.dao.PersonDao, etc.

        Show
        Edouard Laroche-Joubert added a comment - Hi Matt, well when you want your code to be generated you use: mvn appfuse:gen -Dentity=Person that works fine, it generates it in org.appfuse.model.Person, org.appfuse.dao.PersonDao etc.... But what about having a package in between for example : org.appfuse.salary.model.Person, org.appfuse.dao.PersonDao, etc.. You have to refactor all the classes, check the xml files etc... here you use: mvn appfuse:gen -Dentity=Person -DfullPath=org.appfuse.salary.model (or something like that, I forgot a bit about, I did it the 4th of february sorry). and it generates : org.appfuse.salary.model.Person, org.appfuse.salary.dao.PersonDao, etc.
        Hide
        Matt Raible added a comment -

        Fixed and documented at http://appfuse.org/display/APF/AppFuse+Maven+Plugin.

        The default package name is $

        {groupId}.model.Name. If you want to generate your code in a sub-package, specify a full package name like -Dentity=com.myproject.subpackage.model.Name or -Dentity=~.subpackage.model.Name. The tilde is a shortcut for ${groupId}

        .

        Show
        Matt Raible added a comment - Fixed and documented at http://appfuse.org/display/APF/AppFuse+Maven+Plugin . The default package name is $ {groupId}.model.Name. If you want to generate your code in a sub-package, specify a full package name like -Dentity=com.myproject.subpackage.model.Name or -Dentity=~.subpackage.model.Name. The tilde is a shortcut for ${groupId} .

          People

          • Assignee:
            Matt Raible
            Reporter:
            Edouard Laroche-Joubert
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development