Results 1 to 5 of 5

Thread: Maven to automarically generate .aj files

  1. #1
    Join Date
    May 2007
    Location
    Sofia, Bulgaria
    Posts
    11

    Default Maven to automarically generate .aj files

    Hi guys,

    I have the following problems: roo console is generating some .aj files for me in my project. Do I need those .aj files in the SVN?
    1) Some of them I don't need and can safely delete and ignore from the SVN. The build then works fine and I can commit. But some of them cannot be deleted because

    mvn clean install

    will fail to compile the project. And the problem becomes really big when you have a CI server (like hudson or bamboo) that will not be able to run the roo console to generate those .aj files before the build. So it looks like I need them.
    2) If I need them, does it really make sense to leave them in the SVN as they are every time regenerated? It looks ugly for me to bloat the SVN with additional files that are always regenerated.

    Is there a Maven plugin that will generate the .aj files for me? Maybe I can bind it to any phase before compile?

    Thank you for your time.

  2. #2

    Default

    You should not delete .aj files or nothing will work after a IDE or maven clean/rebuild of the project.
    The compile goal in maven is made with aspecj compiler plugin, so you need those .aj to work properly. I recommend you to storage it on your SVN because is not totally autogenerated code, it relays on the roo script you made and may not be easy to restore.
    Just as a note, remember that .aj files are managed by roo and if you change something you have to make a push-in refactor to the .java class or roo will overwrite your changes.

    As general rule in my enterprise we have to keep in SVN everything needed to run the proyect without errors with maven. I think your approach is not the more correct one but if you want to, you could use http://mojo.codehaus.org/exec-maven-...exec-mojo.html to run a "roo" command on the project source and let all the .aj files get regenerated.
    Last edited by Domingo Gómez García; Mar 20th, 2011 at 09:44 AM.

  3. #3
    Join Date
    May 2007
    Location
    Sofia, Bulgaria
    Posts
    11

    Default

    Hi Domingo,

    Thanks for replying.

    "I think your approach is not the more correct one but if you want to, you could use http://mojo.codehaus.org/exec-maven-...exec-mojo.html to run a "roo" command on the project source and let all the .aj files get regenerated. "

    yeah, that's what I did and so far it works good on development and bamboo server.

    Cheers, Petar.

    (Hey I write to Domingo on Sunday - what a coincidence ) ...

  4. #4

    Default

    Hi Paranoiabla,

    Thanks for your post. Can you please tell us the roo command you mentioned to generate .aj files from exec-maven-plugin?

    Many thanks!

  5. #5
    Join Date
    Jun 2008
    Location
    Philadelphia, PA, USA
    Posts
    212

    Default

    You should just run "roo quit" - that will fire up Roo, generate any missing .aj files, then exit the shell.
    Ken Rimple
    Chariot Solutions
    email: krimple@chariotsolutions.com
    work: www.chariotsolutions.com/education
    personal: www.rimple.com

    Author: Spring Roo in Action (Manning)
    MEAP Site: manning.com/rimple

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •