Introduction
Dub supports package suppliers of type Dub Registry, Maven and File System. By default, Dub will search on Dub Registry https://code.dlang.org and hard-coded and user-set fallbacks.
Package suppliers can be specified either using argument --registry
or globally using setting registryUrls
. The type of the package supplier can be specified by prefixing the URL with dub+
for type Dub Registry, mvn+
for type Maven or using the file://
scheme for type File System. Without a prefix, the type Dub Registry (dub+
) is assumed.
Dub Registry
Dub packages are registered at a Dub Registry server like https://code.dlang.org. It isn't needed to prefix the address of a Dub Registry.
- https://code.dlang.org/
- dub+https://code.dlang.org/
Maven repository
Dub can retrieve dub package zip archives located within a Maven repository like Nexus or Artifactory. The registry address needs to contain the Maven repository and a group id. The dub packages needs to be stored with a common group id, the dub package name as artifact id and dub version as artifact version. The dub package zip file must have the name [packageName]-[version].zip
.
Example
Dub package zip archive calculator-1.0.0.zip
is stored on Maven repository http://localhost:8040/maven/libs-release using group id dubpackages
. As registry address mvn+http://localhost:8040/maven/libs-release/dubpackages
needs to be specified.
dub fetch [email protected] --skip-registry=all --registry=mvn+http://localhost:8040/maven/libs-release/dubpackages
File system
A folder containing dub packages as zip files could be specified as registry. The zip files must have the name [packageName]-[version].zip
.
- Linux
dub fetch calcula[email protected] --skip-registry=all --registry=file:///var/dubpackages
- Windows
dub fetch calculat[email protected] --skip-registry=all --registry=file:///c:/d/dubpackages