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

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

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標籤內加入如下代碼便可解決報錯:maven

<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>  
相關文章
相關標籤/搜索