Skip to content

Commit

Permalink
Improved search query
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalter committed Jun 1, 2022
1 parent acf05b6 commit ebc8a16
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

## [1.6.0] - 2022-06-01
### Changed
- Improved search query for Maven Central

## [1.5.0] - 2022-05-26
### Added
- Parse versions from properties section if placeholders are used
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pluginGroup = ch.newinstance.plugin.mavendependencychecker
pluginName = MavenDependencyChecker
# SemVer format -> https://semver.org
pluginVersion = 1.5.0
pluginVersion = 1.6.0

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand All @@ -13,7 +13,7 @@ pluginUntilBuild = 221.*

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IC
platformVersion = 2021.3.2
platformVersion = 2021.3.3

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class MavenSearchClient {

private static final String MAVEN_BASE_SEARCH_URI = "https://search.maven.org/solrsearch/select?wt=json&q=";
private static final String MAVEN_BASE_SEARCH_URI = "https://search.maven.org/solrsearch/select?wt=json&core=gav&q=";

private static final ExecutorService executorService = Executors.newFixedThreadPool(5);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class VersionComparator {

private static final String RESPONSE = "response";
private static final String DOCS_ARRAY = "docs";
private static final String LATEST_VERSION = "latestVersion";
private static final String VERSION = "v";
private static final String GROUP = "g";
private static final String ARTIFACT = "a";

Expand All @@ -37,7 +37,7 @@ public List<DependencyUpdateResult> compareVersions(List<String> jsons) {
JSONObject docsObject = response.getJSONArray(DOCS_ARRAY).getJSONObject(0);
String groupId = docsObject.getString(GROUP);
String artifactId = docsObject.getString(ARTIFACT);
String latestVersion = docsObject.getString(LATEST_VERSION);
String latestVersion = docsObject.getString(VERSION);
ComparableVersion latestVersionComparable = new ComparableVersion(latestVersion);

String key = groupId + ":" + artifactId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private String getResponse() {
"\"id\": \"org.apache.commons:commons-lang3\"," +
"\"g\": \"org.apache.commons\"," +
"\"a\": \"commons-lang3\"," +
"\"latestVersion\": \"3.12.0\"," +
"\"v\": \"3.12.0\"," +
"\"repositoryId\": \"central\"," +
"\"p\": \"jar\"" +
"}" +
Expand Down

0 comments on commit ebc8a16

Please sign in to comment.