Community
Participate
Working Groups
The compiler makes this warning if "aspectrt.jar" file has a different name like "aspectrt-1.3.jar", which is the case when compiling with maven.
I thought we fixed this last year. Has no one been using AspectJ with Maven? AjBuildManager.checkRtJar(..) is looking for "aspectjrt.jar", not if (p.isFile() && p.getName().startsWith("aspectjrt") && p.getName().toLowerCase().endsWith(".jar")) { AjcTask.findAspectjtoolsJar(..) has more specific logic to find versioned jars. Neither would select the correct version from a classpath.
Wes, This warning occurs if I am compiling with ajc command line, ant or maven, the three of them. It does not seem that either classes (AjBuildManager and AjcTask) is giving the warning. AjBuildManager has to do with ajdt, and not with command line/ant/maven. AjcTask is used by ant and maven, but not with the command line, right? Either way, AjcTask.findAspectjtoolsJar(..) find aspectjtools.jar, and not aspecjrt.jar, which is the source of this issue.
needs resolving for RC1
I've just commited a fix for this to tolerate variations on aspectjrt.jar as proposed by Wes. Will be available in next published developer build on aspectj downloads page. Let me know how this works out with Maven... should be ok for you now I hope.
It's OK for aspectj-DEVELOPMENT-20051110113650.jar.
Ok, I'm seeing this using aspectj-maven-plugin 1.4 with aspectjrt & aspectjtools 1.6.12 & maven 3.0.3: [INFO] --- aspectj-maven-plugin:1.4:compile (default) @ configuration --- [WARNING] couldn't find aspectjrt.jar on classpath, checked: C:\dev\jdks\... Parent pom <pluginManagement> contains: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.4</version> <dependencies> <!-- Avoids "bad version" warning --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.6.12</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <version>1.6.12</version> </dependency> </dependencies> </plugin> Parent pom <plugins> contains: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <configuration> <source>${java.version}</source> <target>${java.version}</target> <encoding>UTF-8</encoding> <complianceLevel>${java.version}</complianceLevel> <preserveAllLocals>true</preserveAllLocals> <showWeaveInfo>false</showWeaveInfo> <aspectLibraries> <aspectLibrary> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> </aspectLibrary> </aspectLibraries> </configuration> <executions> <execution> <goals> <goal>compile</goal> <goal>test-compile</goal> </goals> </execution> </executions> </plugin> Any ideas?
We're compiling with ant task and see the same error even though the jar is present in the classpath [aspectj:iajc] warning couldn't find aspectjrt.jar on classpath, checked: D:\cc_tools\tools\tpv\was\7.0\java\jre\lib\vm.jar;D:\cc_tools\tools\tpv\was\7.0\java\jre\lib\annotation.jar;D:\cc_tools\tools\tpv\was\7.0\java\jre\lib\beans.jar;D:\cc_tools\tools\tpv\was\7.0\java\jre\lib\java.util.jar; ....... Z:\my_module\module\dependencies\lib\main\SUI_Common_UI.jar;Z:\my_module\module\dependencies\lib\main\com.springsource.org.aspectj.runtime-1.6.6.RELEASE.jar;Z:\my_module\module\dependencies\lib\main\com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar;Z:\my_module\module\dependencies\lib\main\com.springsource.org.aspectj.tools-1.6.6.RELEASE.jar; Is there any way/place to define the name of this jar? How do i get around this? We're using aspectj jars rebundled by spring. I also see the same issue when i use the 1.7.0 version.
the code was fixed to allow for 'org.aspectj.runtime' anywhere in the jar name - that was changed years ago but you need to update to a version with the fix in. I notice you are on 1.6.8 weaver and 1.6.6 tools. You should stick to just one version - and I *think* if you update to 1.6.8 tools you will pickup the change that will avoid this message. (Or you could jump to 1.6.12, the most recent 1.6 fix level).
Created attachment 271540 [details] aspectj error
error when executing this in cmd line mvn clean test jacoco:report -DskipITs=true error is as attached
The error in that picture says it cant find the JoinPoint class which does come from the runtime module. On the classpath it shows in the error I don't see the runtime module (I don't think it is saying it must be called aspectjrt.jar but the runtime needs to be there somewhere so the classes can be found).