Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Trying to weave but get error

Hi all,

I guess @Martin Gainty statement about security was had it's best intentions but not very well substantiated.

@Alexander Kriegisch we had the same experience as you and were really pushed to get a new release. Since no answers from project maintainers, that is the least you can ask for in a community based world, we hade to fork and make release. I looked at the new project, nickwongdev' , and it had a one major improvement which was one master pom and modules.

So to the final part, yes I let you wait for the best to last. I have solved the issue.

This part in the failing pom.xml fixed it:

<sources />
<weaveDirectories>
<weaveDirectory>${project.build.directory}/classes</weaveDirectory>
</weaveDirectories>

I don't really know why but it does. Found it after googling for sometime ( thinking I cannot be the first person encountering this).

All help was greatly appreciated from you all!

br,

//mike

In parent pom for all maven modules we have:

<aspectj.maven.plugin.version>1.12.6</aspectj.maven.plugin.version>
<aspectj.version>1.9.5</aspectj.version>

and

<!-- AOP dependencies. -->
<plugin>
<groupId>com.nickwongdev</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>${aspectj.maven.plugin.version}</version>
<configuration>
<complianceLevel>1.8</complianceLevel> <!-- should be changed to ${compiler.compliance.java.version} when the plugin
support java 10. -->
<includes>
<include>**/*.java</include>
<include>**/*.aj</include>
</includes>
<excludes>
<exclude>**/generated-sources/annotations/**</exclude>
</excludes>
<aspectDirectory>src/main/aspect</aspectDirectory>
<testAspectDirectory>src/test/aspect</testAspectDirectory>
<XaddSerialVersionUID>true</XaddSerialVersionUID>
<!-- <showWeaveInfo>true</showWeaveInfo> -->
<aspectLibraries>
<aspectLibrary>
<groupId>com.company.library</groupId>
<artifactId>aspectj-impl</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<id>compile_with_aspectj</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>com.company.library</groupId>
<artifactId>aspectj-impl</artifactId>
<version>${aspectj.impl}</version>
</dependency>
</dependencies>
</plugin>

And in the module with annotation processing and that failed:


<plugin>
<groupId>com.nickwongdev</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>${aspectj.maven.plugin.version}</version>
<configuration>
<complianceLevel>1.8</complianceLevel> <!-- should be changed to ${compiler.compliance.java.version} when the plugin
support java 10. -->
<forceAjcCompile>true</forceAjcCompile>
<Xlint>ignore</Xlint>
<sources />
<weaveDirectories>
<weaveDirectory>${project.build.directory}/classes</weaveDirectory>
</weaveDirectories>
<aspectLibraries>
<aspectLibrary>
<groupId>com.company.library</groupId>
<artifactId>aspectj-impl</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<id>compile_with_aspectj</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>com.company.library</groupId>
<artifactId>aspectj-impl</artifactId>
<version>${aspectj.impl}</version>
</dependency>
</dependencies>
</plugin>

 



Från: aspectj-users-bounces@xxxxxxxxxxx <aspectj-users-bounces@xxxxxxxxxxx> för Alexander Kriegisch <alexander@xxxxxxxxxxxxxx>
Skickat: den 20 mars 2020 14:28
Till: aspectj-users@xxxxxxxxxxx <aspectj-users@xxxxxxxxxxx>
Ämne: Re: [aspectj-users] Trying to weave but get error
 
Martin Gainty schrieb am 20.03.2020 18:36 (GMT +07:00):

> be careful including artifacts from untested repositories..see below

This is available on Maven Central. Furthermore, it is open source and as I said, the fork was created because the original plugin was not maintained for a very long time. Both Nick and I contacted the Mojohaus people and asked them to review and accept the pull request, then publish a new upstream release - so far without any effect. For the last few years this 'nickwongdev' fork has been the only clean way to work with AspectJ in Maven with Java versions 9+. So please gather some information next time before irritating other people with unspecific warning messages. Thank you.

--
Alexander Kriegisch
https://scrum-master.de


> From: aspectj-users-bounces@xxxxxxxxxxx
> <aspectj-users-bounces@xxxxxxxxxxx> on behalf of Mikael Petterson
> <mikaelpetterson@xxxxxxxxxxx>
> Sent: Friday, March 20, 2020 3:04 AM
> To: aspectj-users@xxxxxxxxxxx <aspectj-users@xxxxxxxxxxx>
> Subject: Re: [aspectj-users] Trying to weave but get error
>
>
> Hi,
>
>
> I replaced mojohaus version with
>
>
> <groupId>com.nickwongdev</groupId>
>
> <artifactId>aspectj-maven-plugin</artifactId>
>
> <version>${aspectj.maven.plugin.version}</version>
>
>
> and these versions:
>
>
> <aspectj.maven.plugin.version>1.12.6</aspectj.maven.plugin.version>
> <aspectj.version>1.9.5</aspectj.version>
>
>
> Still the same problem.
>
>
> Two questions comes to my mind:
>
>
>        I my multi-module project is it possible to exclude the failing module?
>        Today I have added settings for aspectj in parent pom.xml
>       
>        MG>if you only have one artifact to exclude try
>        MG>--projects '!module-to-exclude'
>       
>        If it is a classpath problem how could it have been working before I
>        introduced aspectj? Would it not be possible to add generated classes to
>        classpath for aspectj?
>
>
> MG> yes using directory parameter within configuration by executing
> build-helper-maven-plugin
> <plugin>
>  <groupId>org.codehaus.mojo</groupId>
>  <artifactId>build-helper-maven-plugin</artifactId>
>  <version>1.12</version>
>  <executions>
>  <execution>
>  <id>add-test-resource</id>
>  <phase>generate-test-sources</phase>
>  <goals>
>  <goal>add-test-resource</goal>
>  </goals>
>  <configuration>
>  <resources>
>  <resource>
>  <directory>path/to/additional/test/resources</directory>
>  <excludes>
>  <exclude>**/folder-to-exclude/**</exclude>
> MG></snip>
> MG>hth MG>Martin
>
>
> //mike
>
>
> ----------------------------------------
>
> Från: aspectj-users-bounces@xxxxxxxxxxx
> <aspectj-users-bounces@xxxxxxxxxxx> för Alexander Kriegisch
> <alexander@xxxxxxxxxxxxxx>
> Skickat: den 19 mars 2020 07:37
> Till: aspectj-users@xxxxxxxxxxx <aspectj-users@xxxxxxxxxxx>
> Ämne: Re: [aspectj-users] Trying to weave but get error
>
>
> >>> The version of aspectj-maven-plugin is for jdk 11 support. It was
> >>> urgent at the time.
>
> >
> https://github.com/mojohaus/aspectj-maven-plugin/commit/c4164ff
>
> No, this commit was about Java 9/10 support.
>
> >> -- AspectJ version
>
> > [Mikael] 1.9.1
>
> That release also was about Java 10 support:
> https://www.eclipse.org/aspectj/doc/released/README-191.html
>
> Java 11 support came one release later:
> https://www.eclipse.org/aspectj/doc/released/README-192.html
>
> 1.9.3 was Java 12, 1.9.4 had a couple of important bugfixes, 1.9.5
> supports Java 13.
>
> My recommendation is to use this fork:
> https://mvnrepository.com/artifact/com.nickwongdev/aspectj-maven-plugin/1.12.6
>
> It should support AspectJ 1.9.5 (please also upgrade) and up to Java 13.
> The Mojohaus maintainer knows about it and got a pull request. IntelliJ
> IDEA's new 2020.x version will support it too for importing AspectJ
> projects.
>
> > ...\InjectedFunctionForRegressionChecker.java:6:0::0
> > The import ...RegressionSetInjectableFunctionAction cannot be resolved
>
> This rather seems to be some kind of classpath problem, maybe not even
> directly related to AspectJ, but impossible to say for sure without the
> MCVE.
>
>
> --
> Alexander Kriegisch
> https://scrum-master.de
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/aspectj-users
>
>

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/aspectj-users

Back to the top