Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an example with use of Lombok #1

Open
itisbugra opened this issue Dec 11, 2018 · 2 comments
Open

Adding an example with use of Lombok #1

itisbugra opened this issue Dec 11, 2018 · 2 comments

Comments

@itisbugra
Copy link

I'm using Lombok plugin, with JDK 1.8.0_172, when I apply your configuration for Spring, the aspectj-maven-plugin shows me tons of errors with the usage of various language constructs and Lombok.val. For instance, the getter method is implemented by Lombok, but aspectj-maven-plugin sees nothing.

Also, for what it's worth, I would like to use AspectJ language to define my pointcuts instead of programmatic implementation, but it's entirely another story.

Here is a part of the Maven output:

  [ERROR] The type MessageNotification must implement the inherited abstract method Notification.getAlertTitle()
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/notification/MessageNotification.java:21
  public class MessageNotification implements Notification {
  ^^^^^^^^^^^^^^^^^^
  
  [ERROR] The type RawNotification must implement the inherited abstract method Notification.getQualityOfService()
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/notification/RawNotification.java:21
  public class RawNotification implements Notification {
  ^^^^^^^^^^^^^^
  
  [ERROR] The type RawNotification must implement the inherited abstract method Notification.getToken()
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/notification/RawNotification.java:21
  public class RawNotification implements Notification {
  ^^^^^^^^^^^^^^
  
  [ERROR] The type RawNotification must implement the inherited abstract method Notification.getUniqueId()
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/notification/RawNotification.java:21
  public class RawNotification implements Notification {
  ^^^^^^^^^^^^^^
  
  [ERROR] The type RawNotification must implement the inherited abstract method Notification.getRawContent()
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/notification/RawNotification.java:21
  public class RawNotification implements Notification {
  ^^^^^^^^^^^^^^
  
  [ERROR] The type RawNotification must implement the inherited abstract method Notification.getExpiration()
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/notification/RawNotification.java:21
  public class RawNotification implements Notification {
  ^^^^^^^^^^^^^^
  
  [ERROR] The type RawNotification must implement the inherited abstract method Notification.getCollapseId()
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/notification/RawNotification.java:21
  public class RawNotification implements Notification {
  ^^^^^^^^^^^^^^
  
  [ERROR] Type mismatch: cannot convert from String to val
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/medium/apns/ApnsMediumAdapter.java:51
  val topic = authenticationConfiguration.getTargetTopic();
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  [ERROR] The constructor PushyNotification(Notification, val) is undefined
  /obelisk/src/main/java/sa/com/stcpay/blink/obelisk/rush/medium/apns/ApnsMediumAdapter.java:52
  val actualNotification = new PushyNotification(notification, topic);
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@dmengelt
Copy link

dmengelt commented Jan 8, 2019

I have the same issue. Reproducer: https://github.com/domi55/spring-boot-with-aspectj-and-lombok

@HJK181
Copy link

HJK181 commented Jul 9, 2021

Could fix Lombok issues with this configuration:

<plugin>
<groupId>com.nickwongdev</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.12.6</version>
<configuration>
	<source>${java.version}</source>
	<target>${java.version}</target>
	<proc>none</proc>
	<complianceLevel>${java.version}</complianceLevel>
	<showWeaveInfo>true</showWeaveInfo>
	<forceAjcCompile>true</forceAjcCompile>
	<sources />
	<weaveDirectories>
		<weaveDirectory>${project.build.directory}/classes</weaveDirectory>
	</weaveDirectories>
</configuration>
<executions>
	<execution>
		<goals>
			<goal>compile</goal>
		</goals>
	</execution>
</executions>
<dependencies>
	<dependency>
		<groupId>org.aspectj</groupId>
		<artifactId>aspectjtools</artifactId>
		<version>1.9.6</version>
	</dependency>
</dependencies>
</plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants