0

Somehow the IntelliJ CE (2022.2.1) build is not able to resolve the maven plugin dependencies (maven surefire and compiler) and producing error. In fact if more plugins are added they are not resolved.

plugin section of the pom.xml

 <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <mainClass>org.test.MainApplication</mainClass>
                        <layout>JAR</layout>
                    </configuration>
                </plugin>    
    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                    <configuration>
                        <forkCount>1</forkCount>
                        <reuseForks>true</reuseForks>
                        <runOrder>alphabetical</runOrder>
                        <argLine>@{argLine} -Xmx1024m -XX:MaxPermSize=256m</argLine>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.junit.jupiter</groupId>
                            <artifactId>junit-jupiter-engine</artifactId>
                            <version>5.8.2</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5.1</version>
                    <configuration>
                        <source>11</source>
                        <target>11</target>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>1.4.2.Final</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
    </plugins>
        </build>

Same is working through maven command line.

Both the maven versions are same.

Its happening on Windows OS.

I tried the suggestion mentioned here to use the plugin registry and invalidate the cache. But it did not help.

Maven Plugin not found in IntelliJ IDE

Best Regards, Saurav

saurav
  • 5,388
  • 10
  • 56
  • 101
  • Check your "Preferences | Build, Execution, Deployment | Build Tools | Maven" configuration in IntelliJ. In particular, "User settings file" and "Local repository". Also, what is the exact error you get? – Dmitry Khamitov Sep 24 '22 at 23:18
  • Have checked the settings...error is the maven plugins not resolved...i checked in .m2 folder respective plugins are present but somehow not picked up from IntelliJ – saurav Sep 26 '22 at 07:42
  • The settings don't seem to match the instance of Maven running via the command line. Or even (and most likely) the Maven package is different. E.g. IntelliJ uses their bundled one by default, which is of course different from what you run in the CLI. To confirm that run `mvn --version` in your command line and you will see the Maven home directory for your CLI. Also, if you run any `mvn` command within the project with and add the `-X` flag you will see which `settings.xml` is used. I assume different `setings.xml` files are used in your CLI and IntelliJ (again, compare that in Preferences) – Dmitry Khamitov Sep 26 '22 at 09:23

0 Answers0