Maven Error : Maven Project Configuration for Module isn't available

52,780

Solution 1

Right click the module and select the Make Module "project module name" option from the pop up menu. The messages will be shown. But go to Problems and see now. This will clear and correct this problem.

Solution 2

Right-click on pom.xml and then click on "Add as Maven Project".

Solution 3

In my case the problem ocurred after uprgrading IJ from 14.x to 15.x and disappeared when I issued Build -> Rebuild Project

Solution 4

My problem with this error under 2019.3.4 is related to the build delegating to Maven. Idea is letting Maven build my project first and that build is failing because I broke a test. I get around this problem by not allowing IDEA to delegate to Maven. On Mac OS Catalina: Intellij -> Preferences -> Build, Execution, Deployment -> Build Tools -> Runner and uncheck Delegate IDE Build/run actions to Maven

enter image description here

Solution 5

In my case, I had to use the following trick:

  1. Right click the module name in the project panel

  2. Select "Open Module Settings"

  3. In the pop-up window, click Dependencies

  4. Select java version 1.8.0_151

Share:
52,780

Related videos on Youtube

Nat
Author by

Nat

Updated on July 09, 2022

Comments

  • Nat
    Nat almost 2 years

    I keep getting this error when I try to compile my code. I have the pom.xml file in my directories but I am not sure if there is something wrong in there. I found only one link on the internet regarding this and that was not my case: Maven project configuration required for module

    Error:Maven Resources Compiler: Maven project configuration required for module 'updater' isn't available. Compilation of Maven projects is supported only if external build is started from an IDE.

    Here is the content of my pom file:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0     http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>com.nothing.updater</groupId>
        <artifactId>Updater</artifactId>
        <version>1.0-SNAPSHOT</version>
    
    
        <!--<dependencies>-->
            <!--<dependency>-->
                <!--<groupId>com.nothing.toolbox</groupId>-->
                <!--<artifactId>Toolbox</artifactId>-->
                <!--<version>1.1</version>-->
            <!--</dependency>-->
    
        <!--</dependencies>-->
    </project>
    

    I am using a multi-module project.

  • Nat
    Nat over 8 years
    Thanks for your reply, I see. I am gonna try it but two questions: 1. how do I know it originates from line 43 and 2. Where can I see it needs configuration.xml? Thank you!
  • Lars Gendner
    Lars Gendner over 8 years
    To your questions: 1. line 43 reads context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, "Maven project configuration required for module '" + target.getModule().getName() + "' isn't available. Compilation of Maven projects is supported only if external build is started from an IDE."));, which pretty much is the error message you get. And 2. you find that when you descend into JpsMavenExtensionService.getInstance().getMavenProjectConfig‌​uration.
  • matbrgz
    matbrgz over 6 years
    Just had same issue with a rather intricate maven project with 2017.2.1. Why does this help?
  • robbie70
    robbie70 about 5 years
    unbelieveable, I have spent days trying to sort this problem out and tried a million things but finally your solution worked for me ! thank you. For info I am using Intellij 2018.3, java 11 (but only using version 8 language level in my project), maven 3.6. Update : Although this works - there is something strange going on - after I run Rebuild Project and then run my "mvn clean", "mvn validate", "mvn compile" - I sometimes still get the error mentioned above.
  • Mike Miller
    Mike Miller over 4 years
    This just fixed a problem I had when upgrading from 2019.1.2 to 2019.2.1; so whatever is going on, it is still an issue.
  • luizfzs
    luizfzs over 4 years
    Worked on 2018.2.1
  • cellepo
    cellepo over 4 years
    I think this helped me on 2019.2.2 (Ultimate Edition) for Mac.
  • pernpas
    pernpas over 4 years
    I had the same issue when after update to 2019.3 on Ubuntu. After rebuilding the project the problems are gone now
  • packoman
    packoman over 4 years
    This solve this error, that I had: Error:Maven Resources Compiler: Maven project configuration required for module '...' isn't available. Compilation of Maven projects is supported only if external build is started from an IDE.
  • ABC123
    ABC123 over 4 years
    In IntelliJ 2019.3 the menu item I found was 'Build Module <project module name>'.
  • Christoph
    Christoph over 2 years
    Thank you, this simple step helped me too on 2021.2.2 (Community Edition) for Linux!
  • Varun
    Varun over 2 years
    Thanks. But it was already unchecked for me, so didn't work.
  • Varun
    Varun over 2 years
    I'm on intelliJ and can not not find the option to 'Open Module Settings'.
  • Varun
    Varun over 2 years
    It didn't for me. Thanks, tho'.
  • Varun
    Varun over 2 years
    I'm on IntelliJ and I can not find the option to 'Make Module'. Thanks, tho'.
  • Varun
    Varun over 2 years
    It's already added as Maven Project in my case. Tried 'Unlink Maven Project' and followed the solution then, but it didn't work. Thanks, tho'.
  • Jason Huang
    Jason Huang almost 2 years
    Worked for me in 2022. Thanks