The following example demonstrates the various configuration options. Keep in mind that all properties have sensible defaults; only configure them explicitly if the defaults don't match your needs.
apply plugin: 'java' apply plugin: 'eclipse' configurations { provided someBoringConfig } eclipse { //if you want parts of paths in resulting file to be replaced by variables (files): pathVariables 'GRADLE_HOME': file('/best/software/gradle'), 'TOMCAT_HOME': file('../tomcat') classpath { //you can tweak the classpath of the Eclipse project by adding extra configurations: plusConfigurations += [ configurations.provided ] //you can also remove configurations from the classpath: minusConfigurations += [ configurations.someBoringConfig ] //if you don't want some classpath entries 'exported' in Eclipse noExportConfigurations += [ configurations.provided ] //if you want to append extra containers: containers 'someFriendlyContainer', 'andYetAnotherContainer' //customizing the classes output directory: defaultOutputDir = file('build-eclipse') //default settings for downloading sources and Javadoc: downloadSources = true downloadJavadoc = false } }
本文介绍如何使用 Gradle 的 Eclipse 插件来定制 Eclipse 项目的配置,包括路径变量设置、类路径调整、输出目录自定义及源码和 Javadoc 下载选项等。
2243

被折叠的 条评论
为什么被折叠?



