Explain Codes LogoExplain Codes Logo

Maven plugins cannot be found in IntelliJ

java
maven-integration
intellij-configuration
dependency-resolution
Nikita BarsukovbyNikita Barsukov·Jan 21, 2025
TLDR

Verify your Maven setup in IntelliJ swiftly:

  1. Navigate to Settings -> Build Tools -> Maven.
  2. Verify Maven home path and settings.xml file path.
  3. Validate the Local repository path is precise.
  4. Check internet connectivity and firewall settings.

If issues are persistent:

  • Review pom.xml for precise plugin coordinates (groupId, artifactId, version).
  • In terminal, run mvn clean install outside IntelliJ for IDE-specific issue determination.

For diagnosing the problem, run a Maven build from the terminal:

mvn clean install # "mvn clean install" is like the 'have you tried turning it off and on again' fix in the Maven world!

Ensure your settings.xml has a correct central repository configuration:

<mirrors> <mirror> <mirrorOf>central</mirrorOf> <name>Maven Central</name> <url>https://repo.maven.apache.org/maven2</url> <id>central</id> </mirror> </mirrors>

Deep-dive into Maven and IntelliJ configuration

Maven synchronization in IntelliJ settings

Go to Settings -> Build, Execution, Deployment -> Build Tools -> Maven and ensure "Use plugin registry" is ticked. This checkbox brings IntelliJ and Maven's plugins closer together, kind of like Romeo and Juliet, but happier! If it persists, re-import the project's Maven configurations using the Maven Projects pane.

Manual Maven artifact resolution

Yeah, sometimes, we all need to get our hands dirty and do things manually. Open up a cosy IntelliJ terminal (or go wild with an external terminal) and run Maven goals like mvn dependency:resolve or mvn plugin:resolve. This way, you can get more verbose and insightful error messages.

Version management of Maven plugins

Ensure each plugin in your POM file has a specific version defined. While going with the 'latest' version can feel like living life on the edge, it may pull in incompatible updates and cause headaches. So stay safe, stick with specifying versions.

Handling your .m2 repository

Sometimes clearing out old stuff helps a lot (looking at you, packed garage). So, for any problematic plugin, delete the respective folder under .m2/repository/ and re-import the project!

The IntelliJ holy grail for patching and updating

Are you stuck in the stone age with an outdated IntelliJ version? Go to IntelliJ's website and catch up with the latest trends! Regularly updating IntelliJ ensures you get all the cool new features and critical bug fixes.

The lifeline with Maven command-line

Quite the contrary: If IntelliJ's Maven integration is a bit of a headache, consider extracting that pain out. That's right, go directly to the terminal, become one with the command line, and run Maven tasks there!

IntelliJ: Clearing browser history equivalent

Sometimes IntelliJ just needs a quick refresh. Invalidate caches and restart IntelliJ to wipe out any stale data causing the hiccups. Go to File > Invalidate Caches / Restart - it's like hitting that refresh button!