allure-gradle icon indicating copy to clipboard operation
allure-gradle copied to clipboard

Ignoring Aspectj version in allureAspectjWeaverAgent and allure extension without explicit implementation

Open pshakhov opened this issue 3 years ago • 1 comments
trafficstars

I'm submitting a ...

  • [x] bug report
  • [ ] feature request
  • [ ] support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Now we are use in some our projects Java 17. The Aspectj release notes says that version 1.9.8 support Java 17: https://github.com/eclipse/org.aspectj/blob/master/docs/dist/doc/README-198.html

If I set in allureAspectjWeaverAgent version and aspectjVersion in allure extension to 1.9.8, aspectj dumps error log files. But if I add implementation("org.aspectj:aspectjweaver:1.9.8"), errors is gone.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

What is the motivation / use case for changing the behavior?

No aspectj dumps.

Please tell us about your environment:

Allure version 2.9.6
Test framework [email protected]

Other information

https://github.com/allure-framework/allure-gradle/blob/1d1b0583e319e4f069f0d327bcd7b0c66646c021/allure-adapter-plugin/src/main/kotlin/io/qameta/allure/gradle/adapter/AllureAdapterExtension.kt#L45

Seems that property version sets at configuration time and ignores version from aspectjVersion at allure extension: https://github.com/allure-framework/allure-gradle/blob/e956a156f3ea5de121925ac77217e7ec4fe1289a/allure-adapter-plugin/src/main/kotlin/io/qameta/allure/gradle/adapter/AllureAdapterPlugin.kt#L46

I suppose this block must be applied in afterEvaluate (or another way, but not at the configuration time). Also, probably update aspectjVersion by default to 1.9.8

Also this issue can be relating to: https://github.com/allure-framework/allure-gradle/issues/87

Also, now was released version 1.9.9.1 of aspectj, it can be more improved than 1.9.8.

pshakhov avatar May 18 '22 06:05 pshakhov

@pshakhov , are you sure add(project.dependencies.create("org.aspectj:aspectjweaver is evaluated early?

The add in question is located within defaultDependencies which means it happens only when configuration is resolved. I think allure-gradle does not resolve the configuration at the configuration time, so afterEvaluate is not really needed

Would you please provide Gradle Build Scan or a sample project that reproduces the issue?

vlsi avatar Sep 11 '22 08:09 vlsi

Can you try with 2.11.2 I think I changed that behavior.

Previously aspectJ was configured too early and none of the values of the extension were set yet. In my case we had disabled aspectJ in our buildscripts for ages...but until now it was ignored, it's just now when it was actually disabled and we have seen we actually need it.

CristianGM avatar Nov 03 '22 17:11 CristianGM