gradle-aspectj-binary icon indicating copy to clipboard operation
gradle-aspectj-binary copied to clipboard

JCabi wearing problem

Open vincenzocorso opened this issue 4 years ago • 1 comments

I'm trying to build a project using jcabi-aspects. I have gradle 7.1.1

When I do gradle build, I get the following errors on weaveClasses task:

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':weaveClasses' (type 'AjcTask').
  - In plugin 'com.github.sedovalx.gradle-aspectj-binary' type 'com.github.sedovalx.gradle.aspectj.AjcTask' property 'additionalAjcParams' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#missing_annotation for more details about this problem.
  - In plugin 'com.github.sedovalx.gradle-aspectj-binary' type 'com.github.sedovalx.gradle.aspectj.AjcTask' property 'outputDir' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#missing_annotation for more details about this problem.
  - In plugin 'com.github.sedovalx.gradle-aspectj-binary' type 'com.github.sedovalx.gradle.aspectj.AjcTask' property 'source' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#missing_annotation for more details about this problem.
  - In plugin 'com.github.sedovalx.gradle-aspectj-binary' type 'com.github.sedovalx.gradle.aspectj.AjcTask' property 'sourceSets' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#missing_annotation for more details about this problem.
  - In plugin 'com.github.sedovalx.gradle-aspectj-binary' type 'com.github.sedovalx.gradle.aspectj.AjcTask' property 'target' is missing an input or output annotation.
    
    Reason: A property without annotation isn't considered during up-to-date checking.
    
    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
    
    Please refer to https://docs.gradle.org/7.1.1/userguide/validation_problems.html#missing_annotation for more details about this problem.

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 366ms

My build.gradle is:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "com.github.sedovalx.gradle:gradle-aspectj-binary:1.0.45"
    }
}

plugins {
   [...]
}

apply plugin: 'com.github.sedovalx.gradle-aspectj-binary'

group = 'it.vincenzocorso'
version = '0.1.0'
sourceCompatibility = '11'

[...]

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'junit:junit:4.13.2'

    compileOnly 'org.projectlombok:lombok:1.18.20'
    annotationProcessor 'org.projectlombok:lombok:1.18.20'

    implementation 'com.jcabi:jcabi-aspects:0.23.1'

    [...]
}

[...]

aspectjBinary {
    applyJavaPlugin = true
    weaveClasses {
        source = "11"
        target = "11"
        ajcSourceSets = [project.sourceSets.main]
        writeToLog = true
        additionalAjcParams = ['-proceedOnError']
    }
}

What could be the problem?

vincenzocorso avatar Aug 05 '21 08:08 vincenzocorso

I believe the plugin is not compatible with Gradle 7. From the error message, I can tell that they hardened the requirements for task input properties - they should be explicitly marked as inputs by annotations. The fix should be trivial but unfortunately, I have no spare time to test it. If you feel up to it you may try to

  • clone this repo
  • add the annotation to task input properties
  • publish the plugin to the local maven
  • test it on your project
  • create a pull request that I will gladly check and merge

sedovalx avatar Aug 05 '21 08:08 sedovalx