让maven忽略警告信息通过build

简介:

[cc]四月-22 05:02:28 ScriptRunner  - C:\cruisecontrol-bin-2.8.4\projects\*******
*******************.java:[206,2] 警告:sun.net.TelnetOutputStream 是 Sun 的专用 
API,可能会在未来版本中删除
[cc]四月-22 05:02:28 ScriptRunner  -
[cc]四月-22 05:02:28 ScriptRunner  -
[cc]四月-22 05:02:28 ScriptRunner  - [INFO] ------------------------------------
------------------------------------
[cc]四月-22 05:02:28 ScriptRunner  - [INFO] For more information, run Maven with
the -e switch
[cc]四月-22 05:02:28 ScriptRunner  - [INFO] ------------------------------------
------------------------------------
[cc]四月-22 05:02:28 ScriptRunner  - [INFO] Total time: 16 seconds
[cc]四月-22 05:02:28 ScriptRunner  - [INFO] Finished at: Fri Apr 22 05:02:27 CST
2011
[cc]四月-22 05:02:28 ScriptRunner  - [INFO] Final Memory: 32M/77M
[cc]四月-22 05:02:28 ScriptRunner  - [INFO] ------------------------------------
------------------------------------
[cc]四月-22 05:02:28 jectController- trunk Controller: build result event: build
failed

以上是maven的build日志,可以看到是因为引用了sun的jar包,将来可能会被废弃掉,结果就出了警告,之后build就失败了.上谷歌查了下"maven 忽略告警信息",查到一篇文章:
    让Maven正确处理javac警告    http://www.juvenxu.com/2010/09/01/maven-javac-warning/
在这篇文章结尾处,给出了一种解决方法-->设定maven-compiler-plugin的版本为2.3.2.跑到我们的项目的pom.xml文件中看了下,这边的version设置的是2.0.2,改成2.3.2,顺便换了个新版本的maven,maven仓库没去管,然后再编译,问题解决了.

<plugin>  
    <groupId>org.apache.maven.plugins</groupId>  
    <artifactId>maven-compiler-plugin</artifactId>  
    <version>2.3.2</version> <!--解决出现警告时build失败问题--> 
    <configuration>
    <source>1.6</source>
    <target>1.6</target>
    <encoding>UTF-8</encoding> <!--解决GBK映射报错问题-->
    </configuration>
</plugin>  

分类:  Java_Learning

本文转自leipei博客园博客,原文链接:http://www.cnblogs.com/leipei2352/archive/2011/04/22/2024624.html,如需转载请自行联系原作者

目录
相关文章
|
Java Devops jenkins
【devops】三、Build阶段工具——配置maven
【devops】三、Build阶段工具——配置maven
221 0
|
10月前
|
Java Maven Android开发
【Azure Developer】VS Code打包Java maven Project 遇见 BUILD FAILURE
Unknown lifecycle phase "lean". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>
193 5
|
Java Apache Maven
Maven 的Could not calculate build plan错误解决方法(不一定适用,看原因)
Maven 的Could not calculate build plan错误解决方法(不一定适用,看原因)
|
IDE Java Maven
2020.3.4版本idea配置maven出现org.codehaus.plexus.component.repository.exception.ComponentLookupException信息
2020.3.4版本idea配置maven出现org.codehaus.plexus.component.repository.exception.ComponentLookupException信息
1909 0
|
Java Maven
maven install时报错The packaging for this project did not assign a file to the build artifact
maven install时报错The packaging for this project did not assign a file to the build artifact
7955 0
|
Java 编译器 Maven
maven项目build时出现 No compiler is provided in this environment.错误
maven项目build时出现 No compiler is provided in this environment.错误
maven项目build时出现 No compiler is provided in this environment.错误
|
Java Apache Maven
Eclipse创建maven项目时,出现Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources错
Eclipse创建maven项目时,出现Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources错
577 0
Eclipse创建maven项目时,出现Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources错
|
Java Apache Maven
【BUG日记】【Maven】新入职的公司给的本地Maven,创建maven项目时候报错 “Could not calculate build plan: Plugin”
【BUG日记】【Maven】新入职的公司给的本地Maven,创建maven项目时候报错 “Could not calculate build plan: Plugin”
179 0
【BUG日记】【Maven】新入职的公司给的本地Maven,创建maven项目时候报错 “Could not calculate build plan: Plugin”
|
Java Maven Android开发
eclipse新建maven项目:'Building' has encountered a problem. Errors occurred during the build.
eclipse新建maven项目:'Building' has encountered a problem. Errors occurred during the build.
1042 0
eclipse新建maven项目:'Building' has encountered a problem. Errors occurred during the build.
|
Java 程序员 测试技术
Maven的build生命周期和常用plugin
Maven的build生命周期和常用plugin
Maven的build生命周期和常用plugin

推荐镜像

更多