maven-compiler-plugin 版本錯誤解決方法


項目執行Maven build后出現WARNING提示。報如信息如下,根據報錯信息猜測是maven-compiler-plugin的版本信息問題

 

[WARNING]  
[WARNING] Some problems were encountered while building the effective model for com.xxx.xxx:xxxx:jar:0.0.1-SNAPSHOT  
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 16, column 12  
[WARNING]  
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.  
[WARNING]  
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.  
[WARNING]

 

 

POM.xml中maven-compiler-plugin插件信息如下

 

<plugins>    
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>    
        <configuration>    
            <source>1.6</source>    
            <target>1.6</target>    
        </configuration>    
    </plugin>    
</plugins>

 

修改POM.xml,增加maven-compiler-plugin插件版本信息,如下

<plugins>    
    <plugin>
        <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 clean一下再編譯時一切OK了~.~

 


免責聲明!

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



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