Jackie Noi created MCOMPILER-208: ------------------------------------ Summary: plexus-compiler-aspectj does not compile aspects using Java5 language features Key: MCOMPILER-208 URL: https://jira.codehaus.org/browse/MCOMPILER-208 Project: Maven 2.x Compiler Plugin Issue Type: Bug Affects Versions: 3.1 Environment: org.codehaus.plexus:plexus-compiler-aspectj:2.2 Reporter: Jackie Noi
When compiling Java5 Aspects I am getting the messages "annotation type patterns are only supported at Java 5 compliance level or above" or "the @within pointcut expression is only supported at Java 5 compliance level or above" which results in my aspects not being compiled. The values set for <source> and <target> have no influence on that behavior. I debugged the plexus-compiler-aspectj plugin and realized that the aspectj compiler internally decides whether or not to support Java5 language constructs based on the org.aspectj.ajdt.internal.core.builder.AjCompilerOptions#behaveInJava5Way boolean value. Default value is false. My suggestion would be to set this value to true in org.codehaus.plexus.compiler.ajc.AspectJCompiler#setSourceVersion for source versions greater 1.4 using: buildConfig.getOptions().behaveInJava5Way = true; Doing so fixes the problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira