Java 插件会为项目添加一系列的公共属性, 如下所示, 你可以在构建脚本中像项目属性那样直接使用它们 (see ???).
表22.7.Java插件-目录属性
| 属性名称 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| reportsDirName | String | reports | 在构建目录的生成报告的文件夹名 |
| reportsDir | File (read-only) | buildDir/reportsDirName | 该目录下会生成报告 |
| testResultsDirName | String | test-results | 在构建目录的测试结果的result.xml的存放目录名 |
| testResultsDir | File (read-only) | buildDir/testResultsDirName | 测试结果的 result.xml 文件会存放在该文件夹中 |
| testReportDirName | String | tests | 在构建目录的测试报告的文件夹名 |
| testReportDir | File (read-only) | reportsDir/testReportDirName | 测试的测试报告会存放在该目录下 |
| libsDirName | String | libs | 在构建目录下的类库文件夹名 |
| libsDir | File (read-only) | buildDir/libsDirName | 该目录下存放类库 |
| distsDirName | String | distributions | 在构建目录下的distributions文件夹名 |
| distsDir | File (read-only) | buildDir/distsDirName | 该目录下存放生成的distributions |
| docsDirName | String | 在构建目录下的doc文件夹名 | |
| docsDir | File (read-only) | buildDir/docsDirName | 该目录下存放生成的文档 |
| dependencyCacheDirName | String | dependency-cache | 在构建目录下的依赖缓存文件夹名 |
| dependencyCacheDir | File (read-only) | buildDir/dependencyCacheDirName | 该目录用来缓存源依赖信息。 |
表22.8.Java插件-其他配置