Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion source/dub/packagesuppliers/maven.d
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ class MavenRegistryPackageSupplier : PackageSupplier {

SearchResult[] searchPackages(string query)
{
return [];
// Only exact search is supported
// This enables retrival of dub packages on dub run
auto md = getMetadata(query);
if (md.type == Json.Type.null_)
return [];
auto json = getBestPackage(md, query, Dependency(">=0.0.0"), true);
return [SearchResult(json["name"].opt!string, "", json["version"].opt!string)];
}
}

7 changes: 5 additions & 2 deletions test/issue1416-maven-repo-pkg-supplier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ echo "Trying to download maven-dubpackage (latest)"
"$DUB" fetch maven-dubpackage --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages

if ! dub remove maven-dubpackage --non-interactive --version=1.0.6 2>/dev/null; then
die 'DUB did not install latest package from maven registry.'
fi
die 'DUB fetch did not install latest package from maven registry.'
fi

echo "Trying to search (exact) maven-dubpackage"
"$DUB" search maven-dubpackage --skip-registry=all --registry=mvn+http://localhost:$PORT/maven/release/dubpackages | grep -c "maven-dubpackage (1.0.6)"