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

AspectJ Plugin not Working in Gradle 5.0 #7861

Closed
dbuos opened this issue Nov 29, 2018 · 2 comments
Closed

AspectJ Plugin not Working in Gradle 5.0 #7861

dbuos opened this issue Nov 29, 2018 · 2 comments

Comments

@dbuos
Copy link

dbuos commented Nov 29, 2018

Error in aspectj compilation after upgrade to gradle 5.0 in spring security project.

Expected Behavior

Build executed successfully

Current Behavior

Build failed with error

Some problems were found with the configuration of task ':spring-security-aspects:compileJavaAspect'.
> No value has been specified for property 'options.extensionDirs'.
> No value has been specified for property 'options.encoding'.
> No value has been specified for property 'options.debugOptions.debugLevel'.
> No value has been specified for property 'options.forkOptions.executable'.

Context

I'm trying to update spring-security to gradle 5.0 but after applying the change, the build of aspectj not work anymore

Steps to Reproduce (for bugs)

Upgradle gradle version to 5.0 of a project that uses aspectj plugin as in this commit

Environment

@big-guy
Copy link
Member

big-guy commented Nov 29, 2018

I believe this is because the Ajc task has registered inputs that were invalid, but Gradle previously ignored them/did not validate them.

This is copying all properties from compileJava to compileJavaAspect:
https://github.com/dbuos/spring-security/blob/master/buildSrc/src/main/groovy/aspectj/AspectJPlugin.groovy#L51

Gradle doesn't allow properties to have non-null values in 5.0. What can happen is if compileJava has an optional property that's null that will get copied to compileJavaAspect as a required property.

The fix is to only add properties that are required by the Ajc task. It might be better/easier to see if there's a new plugin that does this for you. https://plugins.gradle.org/search?term=aspectj

@big-guy big-guy closed this as completed Nov 29, 2018
@dbuos
Copy link
Author

dbuos commented Nov 30, 2018

@big-guy Thanks a lot! I do filter the props in order to copy only not null values and it's working now

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

2 participants