7

I have a Java/Maven/JSP runs with the Tomcat 8 server. The project structure is as following,

enter image description here

I have this pom.xml file provided below,

<?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.puut.wallet</groupId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <artifactId>WalletApp</artifactId>
    <name>simple-bitcoin-wallet</name>

    <parent>
        <groupId>org.bitcoinj</groupId>
        <artifactId>bitcoinj-parent</artifactId>
        <version>RELEASE</version>
    </parent>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
            </resource>
        </resources>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.bitcoinj</groupId>
            <artifactId>bitcoinj-core</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>18.0</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.20</version>
        </dependency>
        <dependency>
            <groupId>net.glxn</groupId>
            <artifactId>qrgen</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

When I run the project, I get the following error,

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

I took several measures,

a. in the terminal, run `mvn clean`
b. project -> right click -> `Make Module WalletApp`
c. project -> right click -> `Recompile Module WalletApp`
d. File -> Invalide Caches/Restart .... [This restarts the project]
e. Synchronize 

Obviously, none of them worked out to resolve the issue. By the way, I use InteliIJ for the project. What should I do to solve the issue?

Arefe
  • 11,321
  • 18
  • 114
  • 168
  • Try this solution https://stackoverflow.com/questions/32013337/maven-error-maven-project-configuration-for-module-isnt-availabe – Jay Smith May 30 '17 at 04:23
  • I tried solution from that question earlier. It didn't work and still get the same error. – Arefe May 30 '17 at 04:35
  • On the right side of the IDE you should see s `Maven projects` button. If you click, can you see your project in the tool window? If not, try clicking the little _refresh_ button. Does anything change? P.S. you're missing the `target` directory from your project structure, but it will probably be created automatically after importing the project as a maven project. Also you can use @user when replying to someone, so they get a notification :-) – Morfic May 30 '17 at 07:25
  • Delete ipr/iws/iml files, .idea directory and open pom.xml from the welcome screen to import the Maven project in IntelliJ IDEA. – CrazyCoder May 30 '17 at 10:12

1 Answers1

10

In the Event Log, I get an option to Add as maven project. I selected that option and the issue is immediately solved.

enter image description here

Arefe
  • 11,321
  • 18
  • 114
  • 168