저는 Gradle 응용 프로그램에 스프링 기능을 추가하려고했습니다.AspectJ AJC는 aspectj-maven-plugin으로 작업하지만 Gradle은 사용하지 않습니다.
내가 먼저 angel이라는 봄 통합 작업을 얻으려고 노력하고 복사 한 angel이라는-6 스프링-3-통합-2 /] 1 및 Vaadin Spring Integration 내가 https://github.com/SpringSource/spring-framework/blob/master/spring-aspects/aspects.gradle에서 정확한 작업과 Gradle을에서 응용 프로그램을 실행하면 아무것도 얻을 수 없다 Autowired (모든 것이 null 임). 나는 또한이 버전을 시도했다 : 'https://raw.github.com/breskeby/gradleplugins/0.9-upgrade/aspectjPlugin/aspectJ.gradle' 나는 또한 gradle-1-0-spring-aspectj-build-problems에 언급 된 업데이트 된 버전을 사용 하였지만, Maven 플러그인을 제외하고는 스프링 측면 컴파일 타임에 작동하지 않는 것으로 보인다. 는 여기에 내가 마지막으로 사용한 Gradle을 작업입니다 :
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>${aspectj-maven-plugin.version}</version>
<configuration>
<!-- Required as the plugin does not resolve this by default -->
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
응용 프로그램 autowire가 괜찮 : 내가 만들 때
task compileJava(dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME, overwrite: true) {
dependsOn configurations.ajc.getTaskDependencyFromProjectDependency(true, "compileJava")
doLast{
ant.taskdef(resource:"org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties", classpath: configurations.ajc.asPath)
ant.iajc(source:sourceCompatibility, target:targetCompatibility, destDir:sourceSets.main.output.classesDir.absolutePath, maxmem:"512m", fork:"true",
aspectPath:configurations.aspects.asPath, inpath:configurations.ajInpath.asPath, sourceRootCopyFilter:"**/.svn/*,**/*.java",classpath:configurations.compile.asPath){
sourceroots{
sourceSets.main.java.srcDirs.each{
pathelement(location:it.absolutePath)
}
}
}
}
}
그런 다음 메이븐은 다음과 같은 플러그인을 사용하는 pom으로.
Gradle을 작동시키는 데 도움을 줄 수있는 사람이 있습니까?
gradle로 작업하는 aspectj를 얻을 수 있었습니까? 나는 같은 문제에 직면하고있다. – balteo