3
我有一個Java/Maven/JSP與Tomcat 8服務器一起運行。該項目結構如下,模塊所需的Maven項目配置不可用
我有這個pom.xml
文件下面提供,
<?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>
當我運行該項目,我得到以下錯誤,
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.
我採取了幾項措施,
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
顯然,他們都沒有解決這個問題。順便說一下,我使用InteliIJ
作爲項目。我該怎麼做才能解決這個問題?
嘗試這種解決方案https://stackoverflow.com/questions/32013337/maven-error-maven-project-configuration-for-module-isnt-availabe –
我想從這個問題儘早解決。它沒有工作,仍然有相同的錯誤。 – Arefe
在IDE的右側,您應該看到'Maven projects'按鈕。如果您點擊,您是否可以在工具窗口中看到您的項目?如果不是,請嘗試單擊小_refresh_按鈕。有什麼改變嗎?附:你錯過了你的項目結構中的'target'目錄,但它可能會在作爲maven項目導入項目後自動創建。您也可以在回覆某人時使用@user,以便他們收到通知:-) – Morfic