解決Maven web 項目 Cannot detect Web Project version. Please specify version of Web Project through ... 的錯誤


創建maven項目的時候,maven文件頭報錯:

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>

在project標簽內加入以下代碼即可解決報錯:

<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.1</version>  
                </configuration>  
            </plugin>  
        </plugins>  
        <finalName>webserver</finalName>  
    </build>  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM