Gradle 1.0 +Spring + AspectJ build problems

后端 未结 1 997
眼角桃花
眼角桃花 2021-01-06 10:08

I am migrating a Maven build into Gradle for a project relying on @Configurable Spring annotations, however when my (web) application is running none of the @Configurable cl

相关标签:
1条回答
  • 2021-01-06 10:31

    I know this post is 5 years old but I have the answer and it seems nobody else on the internet does. I'm using Gradle 3.3 though (Give me a break, it's 2017). Here's my Gradle build file to get AWS SWF Workflows along with @Asynchronous tags working.

    buildscript {
        repositories {
            maven {
                url "https://maven.eveoh.nl/content/repositories/releases"
            }
        }
    
        dependencies {
            classpath "nl.eveoh:gradle-aspectj:1.6"
        }
    }
    
    project.ext {
        aspectjVersion = '1.8.9'
    }
    
    apply plugin: 'aspectj'
    apply plugin: 'java'
    
    dependencies {
        compile group: 'org.aspectj', name: 'aspectjrt', version:'1.8.9'
        compile group: 'org.aspectj', name: 'aspectjtools', version:'1.8.9'
        compile group: 'org.freemarker', name: 'freemarker', version:'2.3.25-incubating'
        compile group: 'com.amazonaws', name: 'aws-java-sdk-swf-libraries', version:'1.11.22'
        compile group: 'com.amazonaws', name: 'aws-swf-build-tools', version:'1.1'
        compile(group: 'org.springframework.boot', name: 'spring-boot-starter', version:'1.4.0.RELEASE') {
            exclude(module: 'commons-logging')
        }
        compile group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version:'1.4.0.RELEASE'
        testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'1.4.0.RELEASE') {
            exclude(module: 'commons-logging')
        }
        aspectpath group: 'com.amazonaws', name: 'aws-java-sdk-swf-libraries', version:'1.11.22'
    }
    

    The key thing that caught me was adding the aspectpath to the dependencies. Took me ages to figure that out.

    0 讨论(0)
提交回复
热议问题