You have to use '/' character when dealing with resources of type File (as in your example): this is the standard file separator character
// path to the webapp directory
def webappDir = "$projectDir/src/main/webapp"
There are two main situations where you will use ':' character:
- Project or Task paths
When working in a multi-projects build, the character ':' is used to identify a project or a task in the hierarchy : :subProject1
, :subProject:taskA
for example.
A project path has the following pattern: It starts with an optional colon, which denotes the root project. The root project is the only project in a path that is not specified by its name. The rest of a project path is a colon-separated sequence of project names, where the next project is a subproject of the previous project.
More information here : https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:project_and_task_paths
- Dependency configuration
When using the "string notation" for declaring dependencies, you will use ':' as a separator for group/module/version parts, for example: runtime 'org.springframework:spring-core:2.5'
. More information about the dependency notations here: https://docs.gradle.org/current/userguide/dependency_types.html