The Maven and Ivy repositories can be accessed via several protocols. We already learned that we can use the http
and https
protocols. However, we can also use the file
and sftp
protocols. We must provide credentials when we use the sftp
protocol. The file
protocol doesn't support authentication.
The next example build file will use the file
and sftp
protocols to define the Maven and Ivy repositories:
repositories { ivy { // Use file protocol, for example an // accessible network share or local directory. url 'file://Volumes/shared/developers/repo' } maven { url 'sftp://ourcompany.com:22/repo' // With the sftp protocol we must provide // the username and password. credentials { username 'developer' password 'secret' } } }
18.227.79.241