Cleanest way in Gradle to get the path to a jar file in the gradle dependency cache

前端 未结 5 560
难免孤独
难免孤独 2021-02-05 00:36

I\'m using Gradle to help automate Hadoop tasks. When calling Hadoop, I need to be able to pass it the path to some jars that my code depends on so that Hadoop can send that de

5条回答
  •  终归单人心
    2021-02-05 01:33

    I needed lombok.jar as a java build flag to gwt builds this worked great !

    configurations { 
     lombok
    }
    dependencies {
      lombok 'org.projectlombok:lombok+'
    } 
    ext {
       lombok = configurations.lombok.asPath
    }
    
    compileGwt {
      jvmArgs "-javaagent:${lombok}=ECJ"
    }
    

    I was surprised that the resolution worked early enough in the configuraiton phase, but it does.

提交回复
热议问题