Gradle TIPS collection (for myself)

Execution system

How to perform subproject tasks in a multi-project configuration


# gradle :<Subproject name>:<Task name>
$ ./gradlew :doxer-core:clean :doxer-core:build :doxer-core:install 

Setting system

Dependency version range / latest


dependencies {
  compile 'aaa:bbb:1.4+' // 1.4 or more
  compile 'ccc:ddd:latest.integration' //newest version
  compile 'eee:fff:latest.milestone' //Milestone version
  compile 'ggg:hhh:latest.release' //Release version
}

Setting to make an error when a dependent version conflict occurs / Setting to forcibly fix the dependent version


configurations.compile {
  resolutionStrategy {
    failOnVersionConflict()
    force 'aaa:bbb:1.4'
  }
}

Java

Set system properties at run time(application plugin)


applicationDefaultJvmArgs = ["-Djava.library.path=./hoge"]

reference

Recommended Posts

Gradle TIPS collection (for myself)
tips for java.nio.file.Path
Tips for generating files for eclipse projects in Gradle
Nested class (for myself)
Gradle settings memo (multi-project to all in one) for myself
Gradle settings for using JUnit 5
[Java] Tips for writing source
Tips for making APIs generic
Summary of rails validation (for myself)
Library collection useful for Android development
Docker execution memo summarized for myself
Tips for handling enums in thymeleaf
docker single container restart for myself
Tips for handling pseudo-elements in Selenium
[Rails] A collection of tips that are immediately useful for improving performance