Mojo AspectJ Plugin

compilation skipped when all aspects and classes are external

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.3
  • Component/s: None
  • Labels:
    None
  • Environment:
    Affects versions: 1.0-beta-2, 1.0-beta-4-20060921.212218-1
  • Number of attachments :
    1

Description

I am trying to weave a jar with an aspect library. There are no aspects or classes in the project. The plugin exits without weaving the jar. If I run mvn -X, I get this:

[DEBUG] No sources found skipping aspectJ compile

Activity

Hide
Kaare Nilsen added a comment -

hmm.. tricky

There would be difficult for me figuring out if something has changed in the aspect library or in the jar to weave for that sake, but when you mention it this could also explain some strange behaviour in my own project, forcing me to do a clean install sometimes

But one thought come to mind, would it be ok with a forceCompile flag to be set eighter from the CLI or the pom ?

Show
Kaare Nilsen added a comment - hmm.. tricky There would be difficult for me figuring out if something has changed in the aspect library or in the jar to weave for that sake, but when you mention it this could also explain some strange behaviour in my own project, forcing me to do a clean install sometimes But one thought come to mind, would it be ok with a forceCompile flag to be set eighter from the CLI or the pom ?
Hide
Ken Geis added a comment -

Currently I create a dummy class to work around this. I would prefer a forceCompile configuration in the POM over that.

Show
Ken Geis added a comment - Currently I create a dummy class to work around this. I would prefer a forceCompile configuration in the POM over that.
Hide
Olivier Michallat added a comment -

+1 for the forceCompile option

I'm testing using AspectJ to enforce development contracts at compile-time. The idea is to have compilation fail if architectural patterns are violated (e.g calling a method from the wrong layer, etc.).

This works fine the first time, but when building a second time in a row, the plugin doesn't invoke the ajc compiler because neither sources nor configuration have changed. Therefore the project can be built, in spite of contract violation.

This is not exactly the same case as Ken, as I get the message "No modifications found skipping aspectJ compile".

For whatever it's worth, I'm attaching a (very simple) patch to solve my problem. I've tried to handle Ken's case as well (forcing compilation even if no sources are found), but then the ajc compiler complains that no sources were specified. I've not tried his exact situation though (external jar with external aspects).

Please note that I've had problems running the tests : some fail from CLI, but they work from Eclipse (except AjcReportMojoTest, but it also fails without my changes).

Show
Olivier Michallat added a comment - +1 for the forceCompile option I'm testing using AspectJ to enforce development contracts at compile-time. The idea is to have compilation fail if architectural patterns are violated (e.g calling a method from the wrong layer, etc.). This works fine the first time, but when building a second time in a row, the plugin doesn't invoke the ajc compiler because neither sources nor configuration have changed. Therefore the project can be built, in spite of contract violation. This is not exactly the same case as Ken, as I get the message "No modifications found skipping aspectJ compile". For whatever it's worth, I'm attaching a (very simple) patch to solve my problem. I've tried to handle Ken's case as well (forcing compilation even if no sources are found), but then the ajc compiler complains that no sources were specified. I've not tried his exact situation though (external jar with external aspects). Please note that I've had problems running the tests : some fail from CLI, but they work from Eclipse (except AjcReportMojoTest, but it also fails without my changes).
Hide
Olivier Michallat added a comment -

Adds a 'forceAjcCompile' to force ajc compilation even if no sources have been modified and the ajc options haven't changed.

Show
Olivier Michallat added a comment - Adds a 'forceAjcCompile' to force ajc compilation even if no sources have been modified and the ajc options haven't changed.
Hide
Kaare Nilsen added a comment -

good.. will apply the patch one of the following days, but need to add some stuff on it to make it work as we want (from the cli e.g.)

Show
Kaare Nilsen added a comment - good.. will apply the patch one of the following days, but need to add some stuff on it to make it work as we want (from the cli e.g.)
Hide
David J. M. Karlsen added a comment -

Fixed in rev 10426 and updated snapshot deployed.

Show
David J. M. Karlsen added a comment - Fixed in rev 10426 and updated snapshot deployed.
Hide
Jakub Holư added a comment -

I'm happy that after 2 years it finally made it into the source code. Looking forward for a release with the fix and hopefully also with the option to force compilation even if the project contains no sources (external aspects applied to dependencies).

Show
Jakub Holư added a comment - I'm happy that after 2 years it finally made it into the source code. Looking forward for a release with the fix and hopefully also with the option to force compilation even if the project contains no sources (external aspects applied to dependencies).

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: