jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 1.x AspectJ Plugin
  • MPASPECTJ-1

Upgrade or add plugin for AspectJ 1.1

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 3.0
  • Labels:
    None

Description

I'd like Maven to include support for the recently-released AspectJ 1.1. In the run-up to Maven's RC1, I'd like to find a committer willing to incorporate the plugin fixes for AspectJ 1.1 that I documented in our Development Environment Guide section "Ant support", subsection "Maven support":

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-home/doc/devguide/antTasks-maven.html

You can download AspectJ from

http://eclipse.org/aspectj

It contains the libraries to be published to the repository and the documentation.

Fair warning: I won't be available much before the Maven release candidate. Up until tomorrow (Wed 11) afternoon, I'll be available off and on to support this upgrade. Sorry for not submitting a tested patch, but (modulo version naming issues) this should be a drop-in replacement and tests out fine on my machine.

At some point I'd really like to make a plugin that uses AspectJ 1.1's binary weaving, since this would fit better with many of the typical use-cases for AspectJ. If someone is gung-ho to work on that in the near term, I'd be happy to share the build rules that I think would support most use-cases.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    maven-aspectj-1.1.1-src.zip
    14/Jul/03 9:03 AM
    6 kB
    Maurice Montg?nie
    1. File
      maven-aspectj-1.1.1-src/.cvsignore 0.0 kB
    2. File
      maven-aspectj-1.1.1-src/plugin.jelly 3 kB
    3. File
      maven-aspectj-1.1.1-src/plugin.properties 0.0 kB
    4. File
      maven-aspectj-1.1.1-src/project.properties 0.3 kB
    5. XML File
      maven-aspectj-1.1.1-src/project.xml 2 kB
    6. File
      maven-aspectj-1.1.1-src/xdocs/.cvsignore 0.0 kB
    7. XML File
      maven-aspectj-1.1.1-src/.../changes.xml 0.9 kB
    8. XML File
      maven-aspectj-1.1.1-src/xdocs/goals.xml 1 kB
    9. XML File
      maven-aspectj-1.1.1-src/xdocs/index.xml 0.7 kB
    10. XML File
      maven-aspectj-1.1.1-src/.../navigation.xml 0.5 kB
    11. XML File
      maven-aspectj-1.1.1-src/.../properties.xml 4 kB
    Download Zip
    Show
    Zip Archive
    maven-aspectj-1.1.1-src.zip
    14/Jul/03 9:03 AM
    6 kB
    Maurice Montg?nie

Issue Links

is depended upon by

Task - A task that needs to be done. MAVEN-401 Release maven-b10

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

New Feature - A new feature of the product, which has yet to be developed. MPASPECTJ-8 Weaving classes not jars, and many other features

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Jason van Zyl added a comment - 10/Jun/03 10:01 PM

I'm using Aspect 1.1 for many things and I'll update the plugin for the rc1 release.

Show
Jason van Zyl added a comment - 10/Jun/03 10:01 PM I'm using Aspect 1.1 for many things and I'll update the plugin for the rc1 release.
Hide
Permalink
Wes Isberg added a comment - 12/Jun/03 1:50 AM

This is to send some thoughts on how to set up better build rules than the current plugin – not that you asked or need advice, but I thought that if you're working on it, it might help to review at least one approach before you get started. Mind you, I'd be happy if you just replicate the behavior in the initial plugin, and I'm sorry I can't render this as a jelly script patch.

Bytecode weaving and binary aspects make it easier to layer in aspects and to use aspects from another projects. A set of build rules could be:

0 javac/.java compiles happen as usual

1 use AspectJ to compile aspectsrc/ directory
or .aj files in src/ directory into
{product}-aspects.jar. If aspects are unchanged,
this need not be recompiled.

2 do 1 unless ${aspect-config-file}; if so, build
{product}-aspectj.jar using
-argfile ${aspect-config-file

3 if ${use-aspects-default} is true, then
by default weave any available {product}-aspects.jar
with the initial {product}.jar (produced by javac)
to create a final {product}.jar (urk: names)

4 if ${aspectpath} is defined, then use that to weave
final, notwithstanding rule 3 not being triggered.

5 perhaps support a separate default for testsrc?

6 if a project has required production aspects
(i.e., all the code must always be compiled with
aspectj), then either the code can all be put in
aspectsrc and the jar names fixed up or the
build.compiler property can be set to use
AspectJ or use a flag ${requires.aspectj} or
use a goal. (read: i dunno)

7 (unfortunately) if the aspects change, then the
base system also might need to be recompiled.
This is beyond the standard dependency checking.

These rules/controls should cover the standard use cases:

  • aspects acting as compile-time checks
    (e.g., of architectural constraints)
  • test-only (optional or required), but only for testsrc
  • optional debugging or profiling aspects
    in production code
  • required aspects in the production system
  • any of the above using aspects from another (common) project

This approach minimizes the use of the AspectJ compiler. I think most users will be relieved to continue using their Java compiler where possible. It helps that if their aspects don't change, the only cost is the bytecode weaving step at the end, but it hurts that if they do change, any potentially-affected code should be rewoven if not recompiled.

Thanks for listening. I'll be here Wed a.m. (pacific) if you have questions.

Show
Wes Isberg added a comment - 12/Jun/03 1:50 AM This is to send some thoughts on how to set up better build rules than the current plugin – not that you asked or need advice, but I thought that if you're working on it, it might help to review at least one approach before you get started. Mind you, I'd be happy if you just replicate the behavior in the initial plugin, and I'm sorry I can't render this as a jelly script patch. Bytecode weaving and binary aspects make it easier to layer in aspects and to use aspects from another projects. A set of build rules could be: 0 javac/.java compiles happen as usual 1 use AspectJ to compile aspectsrc/ directory or .aj files in src/ directory into {product}-aspects.jar. If aspects are unchanged, this need not be recompiled. 2 do 1 unless ${aspect-config-file}; if so, build {product}-aspectj.jar using -argfile ${aspect-config-file 3 if ${use-aspects-default} is true, then by default weave any available {product}-aspects.jar with the initial {product}.jar (produced by javac) to create a final {product}.jar (urk: names) 4 if ${aspectpath} is defined, then use that to weave final, notwithstanding rule 3 not being triggered. 5 perhaps support a separate default for testsrc? 6 if a project has required production aspects (i.e., all the code must always be compiled with aspectj), then either the code can all be put in aspectsrc and the jar names fixed up or the build.compiler property can be set to use AspectJ or use a flag ${requires.aspectj} or use a goal. (read: i dunno) 7 (unfortunately) if the aspects change, then the base system also might need to be recompiled. This is beyond the standard dependency checking. These rules/controls should cover the standard use cases:
  • aspects acting as compile-time checks (e.g., of architectural constraints)
  • test-only (optional or required), but only for testsrc
  • optional debugging or profiling aspects in production code
  • required aspects in the production system
  • any of the above using aspects from another (common) project
This approach minimizes the use of the AspectJ compiler. I think most users will be relieved to continue using their Java compiler where possible. It helps that if their aspects don't change, the only cost is the bytecode weaving step at the end, but it hurts that if they do change, any potentially-affected code should be rewoven if not recompiled. Thanks for listening. I'll be here Wed a.m. (pacific) if you have questions.
Hide
Permalink
Maurice Montg?nie added a comment - 14/Jul/03 9:03 AM

Here is the updated aspectj plugin that i'm using for a while.

Show
Maurice Montg?nie added a comment - 14/Jul/03 9:03 AM Here is the updated aspectj plugin that i'm using for a while.
Hide
Permalink
Vincent Massol added a comment - 21/Sep/03 12:46 PM

Working on it as we speak... Not sure it'll be ready for 1.0rc1 though. Will try my best.

Show
Vincent Massol added a comment - 21/Sep/03 12:46 PM Working on it as we speak... Not sure it'll be ready for 1.0rc1 though. Will try my best.
Hide
Permalink
Wes Isberg added a comment - 21/Sep/03 1:09 PM

fyi, as of today aspectj 1.1.1 is a hair's breadth from releasing. The most relevant update is that resources in -injar entries are now automatically copied to the -outjar or -d destDir. The release candidate is at

http://download.eclipse.org/technology/ajdt/aspectj-1.1.1rc1.jar.

Show
Wes Isberg added a comment - 21/Sep/03 1:09 PM fyi, as of today aspectj 1.1.1 is a hair's breadth from releasing. The most relevant update is that resources in -injar entries are now automatically copied to the -outjar or -d destDir. The release candidate is at http://download.eclipse.org/technology/ajdt/aspectj-1.1.1rc1.jar.
Hide
Permalink
Vincent Massol added a comment - 21/Sep/03 4:52 PM

ok. Thanks Wes. I've just committed the first version of the new 2.0 aspectj plugin!

I can always update it to 1.1.1 if it is released before maven rc1 release.

I have a few questions:

  • the Xnoweave attribute seems not to work (it says it is ignoring it but I don't know if I've used it correctly: I wrote: X="noweave").
  • is it really not possible to weave on class files rather than on jar? That would help. I'm currently weaving on jar but some plugins (like the war one) use class files directly without going through the jar step

Could you have a quick review of the plugin and tell me if it matches what you were expecting?

Thanks
-Vincent

Show
Vincent Massol added a comment - 21/Sep/03 4:52 PM ok. Thanks Wes. I've just committed the first version of the new 2.0 aspectj plugin! I can always update it to 1.1.1 if it is released before maven rc1 release. I have a few questions:
  • the Xnoweave attribute seems not to work (it says it is ignoring it but I don't know if I've used it correctly: I wrote: X="noweave").
  • is it really not possible to weave on class files rather than on jar? That would help. I'm currently weaving on jar but some plugins (like the war one) use class files directly without going through the jar step
Could you have a quick review of the plugin and tell me if it matches what you were expecting? Thanks -Vincent
Hide
Permalink
Wes Isberg added a comment - 22/Sep/03 6:34 PM

Thanks for doing that! It's really great to hear. Some replies:

Sorry, I haven't had time to boot maven and check it out. I might have time before Thursday.

1.1.1 was released today.

Sorry, -Xnoweave is special-cased: use `Xnoweave="true"` (That said, I strongly recommend never using that option. It's unsupported (-X) and known to have bugs.)

It would be more convenient to weave from a directory of .class files, but (a) we haven't implemented it yet, mostly because (b) it raises questions of what to do if a .class file changes. Supporting only zip archives helps enforce the requirement to collect together all the binary input to be considered.

I suppose we could have an Ant task should support an option `-Xindir {dir}`. It would create a zip for the contents of {dir}, delete the contents, and add {dir} to the -injars list. In the case of compiler errors, it would have to restore the contents of the directory. Like -copyInjars, this might migrate back to the compiler once used.

Show
Wes Isberg added a comment - 22/Sep/03 6:34 PM Thanks for doing that! It's really great to hear. Some replies: Sorry, I haven't had time to boot maven and check it out. I might have time before Thursday. 1.1.1 was released today. Sorry, -Xnoweave is special-cased: use `Xnoweave="true"` (That said, I strongly recommend never using that option. It's unsupported (-X) and known to have bugs.) It would be more convenient to weave from a directory of .class files, but (a) we haven't implemented it yet, mostly because (b) it raises questions of what to do if a .class file changes. Supporting only zip archives helps enforce the requirement to collect together all the binary input to be considered. I suppose we could have an Ant task should support an option `-Xindir {dir}`. It would create a zip for the contents of {dir}, delete the contents, and add {dir} to the -injars list. In the case of compiler errors, it would have to restore the contents of the directory. Like -copyInjars, this might migrate back to the compiler once used.
Hide
Permalink
dion gillard added a comment - 29/Sep/03 2:07 AM

This really isn't an issue for 1.0.

What do we do? Close it? Set up a separate jira project for the plugin?

Show
dion gillard added a comment - 29/Sep/03 2:07 AM This really isn't an issue for 1.0. What do we do? Close it? Set up a separate jira project for the plugin?
Hide
Permalink
Vincent Massol added a comment - 07/May/04 3:24 PM

We're now using AspectJ 1.2rc1 which allows bytecode weaving into directories.

Show
Vincent Massol added a comment - 07/May/04 3:24 PM We're now using AspectJ 1.2rc1 which allows bytecode weaving into directories.

People

  • Assignee:
    Vincent Massol
    Reporter:
    Wes Isberg
Vote (1)
Watch (2)

Dates

  • Created:
    10/Jun/03 7:37 PM
    Updated:
    07/May/04 3:24 PM
    Resolved:
    07/May/04 3:24 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.