w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
IntelliJ IDEA 13 + Gradle + Spring-data-neo4j + Aspectj Configuration

Finally got this to work (at least this part of it). Final build.gradle:

apply plugin:'base'
apply plugin:'java'
apply plugin:'idea'

buildscript {
    repositories {
        maven {
            url "https://maven.eveoh.nl/content/repositories/releases"
        }
    }
    dependencies {
        classpath "nl.eveoh:gradle-aspectj:1.4"
    }
}

repositories {
    maven {
        url "http://m2.neo4j.org/content/repositories/releases/"
    }
    mavenCentral()
    mavenLocal()
}

project.ext {
    springVersion = "4.0.3.RELEASE"
    neo4jVersion = "2.0.1.RELEASE"
    springDataGraphVersion = "3.0.1.RELEASE"
    aspectjVersion = "1.7.4"

    sourceCompatibility = 1.7
    targetCompatibility = 1.7
}

apply plugin: 'aspectj'

compileAspect {
    xlint = 'warning'
}

dependencies {
    compile 'org.slf4j:slf4j-api:1.7.6'

    compile "org.springframework:spring-context:${springVersion}"
    compile "org.neo4j:neo4j:${neo4jVersion}"
    // Provides Repository based Object <-> Graph Mapping
    compile "javax.validation:validation-api:1.0.0.GA"
    compile
"org.springframework.data:spring-data-neo4j-aspects:${springDataGraphVersion}"
    compile 'javax.persistence:persistence-api:1.0-rev-1'


    testCompile 'junit:junit-dep:4.11'
    testCompile "org.springframework:spring-test:${springVersion}"
    testCompile 'org.hamcrest:hamcrest-all:1.3'
    // Access to Neo4j testing facilities: TestGraphDatabaseFactory
    testCompile "org.neo4j:neo4j-kernel:${neo4jVersion}:tests@jar"
    testRuntime 'org.slf4j:slf4j-simple:1.7.5'

    //aspectj dependencies
    aspectpath "org.aspectj:aspectjtools:${aspectjVersion}"
    compile "org.aspectj:aspectjrt:${aspectjVersion}"
    aspectpath group: "org.springframework.data", name:
"spring-data-neo4j", version: springDataGraphVersion
}

configurations {
    runtime
    compileJava
    testCompileJava
}

// Generate wrapper for Gradle
task wrapper(type: Wrapper) {
    gradleVersion = '1.11'
}

The placement of the buildscript, extra properties, and the apply plugin 'aspectj' matters. I got to fooling around with which order I needed and I have this.

I still don't have weaving properly I think, however, but that's a different topic.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.