Announcement Announcement Module
Collapse
No announcement yet.
Maven to automarically generate .aj files Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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, 09:44 AM.

    Comment


    • #3
      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 ) ...

      Comment


      • #4
        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!

        Comment

        Working...
        X