Question
Why am I not getting the expected artifact search results from the configured Maven repositories in IntelliJ IDEA when searching through:
Project Structure | Project Settings | Libraries | + | From Maven
or when using the Maven Artifact Search window from a pom.xml / build.gradle file?
Answer
The behavior is mostly a consequence of how IntelliJ IDEA integrates with Maven repositories and Maven Central.
There are two separate mechanisms involved:
- Indexing (local search)
- Service-based lookup (remote search)
Understanding the difference between these and what IntelliJ IDEA can and cannot do against Maven Central explains why sometimes there can be no results at all or get "unexpected" suggestions.
1. How IntelliJ IDEA searches for Maven artifacts
IntelliJ IDEA can locate Maven artifacts in two main ways, depending on context:
-
Maven Jar Repositories (“Local” index)
- Shown in: Settings | Build, Execution, Deployment | Build Tools | Maven | Repositories
- These are the repositories that appear under Indexed Maven Repositories.
- For such repositories, IntelliJ can download and maintain a local index (a metadata "map" of all artifacts/versions).
- That index is then used for:
- Code-completion in
pom.xml - Generating dependencies via the Maven Artifact Search dialog
- Some other Maven-aware features
- Code-completion in
-
Artifactory / Nexus / other "service" URLs ("Remote" search)
- Shown under Artifactory or Nexus Service URLs.
- These URLs point to servers that provide a dedicated search API (like Sonatype Nexus or JFrog Artifactory).
- IntelliJ can ask those services directly for artifact search results, without needing to maintain its own index.
When no external search services are configured, IntelliJ IDEA also uses a built-in search service (often via a JetBrains-hosted proxy of Maven Central) for some artifact searches. This is how the Remote Jar Repository looks:
2. Why searching against Maven Central often returns no results
Maven Central (repo.maven.apache.org) is a "dumb" file server. It serves files, but it does not provide a search API that IntelliJ IDEA can query directly.
Because of that, to perform free-text search (e.g., "jakarta.annotation") against Central, IntelliJ IDEA needs either:
- A pre-downloaded local index of Maven Central, or
- A remote search service that knows how to search across Central’s contents.
By default:
- A full local index for Maven Central is not downloaded (to save disk space and bandwidth).
- If there is no Artifactory/Nexus/other search service configured, free-text queries may legitimately return nothing in dialogs such as:
- Project Structure | Libraries | + | From Maven
- "Maven Artifact Search" from
pom.xml/build.gradle
3. Why adding a known dependency usually still works
Even when search returns nothing, resolving a specific dependency by coordinates often still works.
There are two important cases:
-
Using full coordinates in the search field If entered something like:
org.junit.jupiter:junit-jupiter:5.10.0or
jakarta.annotation:jakarta.annotation-api:3.0.0the IDE can construct the direct URL to the
.pom/.jarin the configured repository (for example, Maven Central) and download it, without needing a full index. If the file exists at that path, it will be added successfully.If the complete artifact name is introduced (
jakarta.annotation-api:3.0.0),it'll be added: -
Adding the XML block to the build file and reloading Maven/Gradle If the dependency snippet is manually added to
pom.xml(orbuild.gradle) and then click Reload (Maven/Gradle refresh):- Maven/Gradle use the groupId + artifactId + version to build a direct download URL.
- They try to fetch the files from the configured repositories.
- If the artifact exists, resolution succeeds, regardless of whether IntelliJ’s artifact search index is present.
So:
- Search requires a metadata “map” (index or remote search API).
- Resolution only needs the exact coordinates.
4. Practical workarounds when artifact search shows nothing
When a Maven artifact search shows nothing (or only irrelevant results), there are several effective workarounds and checks that can be done.
4.1. Use full Maven coordinates directly
Try entering the full coordinates into the search field:
groupId:artifactId:version
Examples:
org.junit.jupiter:junit-jupiter:5.9.1jakarta.annotation:jakarta.annotation-api:3.0.0
If the artifact exists in one of the configured repositories, IntelliJ IDEA should still be able to add it, even if free-text searching (e.g. just “junit” or “jakarta.annotation”) returns no results.
This is often the quickest workaround and is useful to confirm that repository configuration and connectivity are working.
4.2. Add the dependency directly to pom.xml or build.gradle and reload
Another robust workaround is to skip the artifact search UI entirely:
-
Copy the dependency block from Maven Central or another source, for example:
<dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.9.1</version> <scope>test</scope> </dependency> -
Paste it into
pom.xml. -
In IntelliJ IDEA, click Load Maven Changes (elephant icon) or use Ctrl+Shift+O / Sync Maven Changes, depending on the version.
-
Maven downloads the dependency and IntelliJ updates the project model.
The same pattern applies for Gradle using:
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
followed by a Gradle refresh.
This confirms that Maven itself and the repository configuration are fine, even if the artifact search window remains empty or misleading.
5. Enabling and updating Maven indexes (when applicable)
If you rely heavily on searching by name (not by full coordinates), it can help to ensure that IntelliJ IDEA has a usable index for the repositories:
- Open: Settings | Build, Execution, Deployment | Build Tools | Maven | Repositories
- In Indexed Maven Repositories:
- Confirm that the relevant repositories appear (often including Maven Central).
- Select the repository and click Update to download or refresh the index.
- Wait for the indexing to complete, then retry the Maven Artifact Search.
Notes:
- On some setups, especially where Artifactory or Nexus are used, the remote search URLs may be present under Artifactory or Nexus Service URLs. In that case, search results are coming from those services, not from the simple “Indexed Maven Repositories” list.
- If those service URLs are unreachable or misconfigured (e.g., HTTP 401, DNS failure), search can also return empty results even though Maven itself can still resolve dependencies.
6. Basic sanity checks to rule out environment issues
If still get no results at all for common artifacts (for example, “junit”, org.junit.jupiter:junit-jupiter), check the following:
-
Maven offline mode in IntelliJ IDEA
- Go to: Settings | Build, Execution, Deployment | Build Tools | Maven.
- Ensure Work offline is unchecked; otherwise, IntelliJ IDEA and Maven will only use what’s already in the local cache.
-
Command-line Maven works
- In the same project directory, run:
-
mvn dependency:resolveor mvn clean install
-
- If this fails, the problem is with Maven/repository configuration itself, not IntelliJ IDEA’s search.
- In the same project directory, run:
-
Network / proxy / firewall
- Verify the network/proxy configuration in: Settings | Appearance & Behavior | System Settings | HTTP Proxy (or the equivalent in the IDE version).
- If a corporate proxy or firewall blocks access to Maven repositories or JetBrains’ search services, the artifact search UI may be empty.
7. When to collect more data or escalate
If, after:
- Trying full coordinates,
- Manually adding the dependency and reloading,
- Updating indexes,
- Confirming Maven and network work correctly,
the Maven Artifact Search window still never returns results, consider gather the next information:
- IDE version and edition (screenshot of Help | About).
- OS and version.
-
Screenshots:
- The exact artifact search dialog (including any “Loading…” message).
- The Maven Repositories settings page and any Artifactory or Nexus Service URLs configuration.
- IDE logs collected right after reproducing the issue once: Help | Collect Logs and Diagnostic Data.
With this information, you can attach logs and screenshots and create a new support ticket, to get further help.
References
https://www.jetbrains.com/help/idea/maven.html
https://www.jetbrains.com/help/idea/maven-repositories.html
https://www.jetbrains.com/help/idea/work-with-maven-dependencies.html
https://www.jetbrains.com/help/idea/testing.html#ij-add-library
Comments
0 comments
Please sign in to leave a comment.