maven常見問題解決

問題1:導入項目提示  Cannot change version of project facet Dynamic Web Module to 2.5linux


解決方案:web

     在工程目錄下有一個.settings文件夾,打開org.eclipse.wst.common.project.facet.core.xml,作以下修改:apache

     將這一行的version改成2.5 就能夠了 <installed facet="jst.web" version="2.5"/>windows



問題2: 「Dynamic Web Module 3.0 requires Java 1.6 or newer.」錯誤eclipse


解決方案:maven

    eclipse maven   ide

    在項目的pom.xml的<build></build>標籤中加入:   ui

        <plugins>  spa

            <plugin>  xml

                <groupId>org.apache.maven.plugins</groupId>  

                <artifactId>maven-compiler-plugin</artifactId>  

                <version>2.3.2</version>  

                <configuration>  

                    <source>1.6</source>  

                    <target>1.6</target>  

                </configuration>  

            </plugin>  

        </plugins>  

  

保存,項目構建完成後在項目文件夾上點右鍵,選擇Maven->Update Project Configuration,問題解決。


問題3:導入項目報Maven error 「Failure to transfer…」

解決方案:刪除掉全部下載失敗的包

linux:

find ~/.m2  -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;

windows:

cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i
相關文章
相關標籤/搜索