解決maven web項目Cannot detect Web Project version. Please specify version of Web Project through...的錯誤
阿新 • • 發佈:2017-07-19
version 錯誤 web http conf mpi int war targe
前面已經聊了創建maven web工程,但是問題來了,創建maven web工程之後會出現如下的錯誤,在pom.xml文件頭部 有以下的錯誤
[plain] view plain copy print?
- Cannot detect Web Project version. Please specify version of Web Project through <version> configuration property of war plugin. E.g.: <plugin> <artifactId>maven-
- war-plugin</artifactId> <configuration> <version>3.0</version> </configuration> </plugin>
解決方法如下:
在pom.xml文件中加入:
[html] view plain copy print?
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <version>3.0</version>
- </configuration>
- </plugin>
- </plugins>
- <finalName>webserver</finalName>
- </build>
那是因為項目未指定maven war編譯插件的錯誤
最後 maven - update project
解決maven web項目Cannot detect Web Project version. Please specify version of Web Project through...的錯誤