Community
Participate
Working Groups
I am currently using the maven aspectj plugin, and all of my jar artifacts are are re-named to .bndl (for reasons beyond my control). Using the aj compiler, I am getting errors when using these .bndl artifacts in the classpath. I would expect that ajc would behave consistently with javac, and not make a distinction solely based on the extension of the classpath entry. Furthermore, I should be able to name an output directory "classes.jar", and be able to use it as a classpath entry. The message "directory classpath entry does not exist" is inaccurate, since the .bndl entry isn't a directory and it does exist. C:\NGST\app\java\util\maven-target>ajc -verbose @classesbuilddef.lst zipfile classpath entry does not exist: C:\j2sdk1.4.2_10\jre\lib\i18n.jar directory classpath entry does not exist: C:\j2sdk1.4.2_10\jre\classes directory classpath entry does not exist: C:\NGST\app\java\logging\maven-target\logging-1.20-SNAPSHOT.bndl compiling C:\NGST\app\java\util\src\com\dcx\NGST\beancontainer\BeanFactoryLevel.java compiling C:\NGST\app\java\util\src\com\dcx\NGST\core\exceptions\UnSupportedMethodException.java
Created attachment 38800 [details] aspectj-maven-plugin created this ajc argument file. notice one of the classpath entries is a .bndl file
In a related problem, the WeavingAdaptor won't accept jars with nonstandard extensions, e.g., here's a simple example. set CLASSPATH=odd.bndl;ren.bndl;%CLASSPATH% java OddJar Hello Java set ASPECTPATH=odd.bndl;ren.bndl aj OddJar error bad aspect library: 'C:\devel\scratch\oddJar\odd.bndl' Error occurred during initialization of VM java.lang.Error: org.aspectj.bridge.AbortException: bad aspect library: 'C:\deve l\scratch\oddJar\odd.bndl' public class OddJar { public static void main(String args[]) { System.out.println("Hello "+getName()); } public static String getName() { return "Java"; } } public aspect Rename { String around() : execution(* getName()) { return "AspectJ"; } }
Created attachment 40157 [details] Multi-module patch to fix & test this This is an Eclipse multi-project patch (across several of the AspectJ modules) with all the changes I made to support jars/zips with nonstandard extensions and directories ending in .jar. This includes a variety of tests including unit, integration, and load-time weaving tests. It also includes some binary files (copies of existing files that were named foo.jar or in top-level directories). I tested applying the patch and unfortunately it corrupts the jar files, causing tests to break. I will attach the binary files that break to be copied over as a zip file in a separate attachment. To allow testing this, I added support for a special variable $sandbox that can be used in classpaths for compile & run specs.
Created attachment 40158 [details] Binary files needed by the patch for test data.
*sigh* - won't apply for me. patches only tests/util/weaver even though I can see it contains changes to other modules.
what level of eclipse did you create the patch on Ron? I'm attempting to apply it on 3.2RC2
I created the patch using 3.2 RC1. Are you serious: it doesn't work on RC2?!?! It is using the Eclipse multi-project patch format. I could resubmit as a bunch of module-level patches...
it may not be the fact that i'm on RC2, it could be something else - i dont use workspace level patches very often. All i know is it patched just 3 modules and not the rest with no indication as to why...
Created attachment 40225 [details] Weaver module patch
Created attachment 40226 [details] Util module patch
Created attachment 40227 [details] Patch for tests module
Created attachment 40228 [details] Testing module patch
Created attachment 40229 [details] Taskdefs module patch
Created attachment 40230 [details] org.aspectj.ajdt.core module patch
thanks ron! You could have put them together in a zip tho ;)
Created attachment 40231 [details] loadtime module patch
Created attachment 40233 [details] AJDE module patch
Ok, next time I will put them in a zip. Note that the binary files needed still has to be unzipped to create/modify files in the workspace so that all the tests will pass.
patches committed. I hope they are ok on Linux and the Mac ... I'll wait for Adrian to scream.
All clear on the mac :)
fix available.