Let Maven ignore warning information through Build

Source: Internet
Author: User

[CC] April 05:02:28 scriptrunner-c: \ cruisecontrol-bin-2.8.4 \ projects \*******
* *****************. Java: [206,2] Warning: sun.net. telnetoutputstream is Sun-specific
API, which may be deleted in future versions
[CC] April 05:02:28 scriptrunner-
[CC] April 05:02:28 scriptrunner-
[CC] April 05:02:28 scriptrunner-[info] ------------------------------------------
------------------------------------
[CC] April 05:02:28 scriptrunner-[info] For more information, run Maven
The-e Switch
[CC] April 05:02:28 scriptrunner-[info] ------------------------------------------
------------------------------------
[CC] April 05:02:28 scriptrunner-[info] total time: 16 seconds
[CC] April 05:02:28 scriptrunner-[info] finished at: Fri Apr 22 05:02:27 CST
2011
[CC] April 05:02:28 scriptrunner-[info] final memory: 32 m/77 m
[CC] April 05:02:28 scriptrunner-[info] ------------------------------------------
------------------------------------
[CC] April 05:02:28 jectcontroller-trunk Controller: Build result event: Build
Failed

The above is the maven build log. We can see that it is because Sun's jar package is referenced and may be discarded in the future. The result is a warning and the build will fail. google checked "Maven ignoring alert information" and found an article:
Let Maven handle javac warning http://www.juvenxu.com/2010/09/01/maven-javac-warning/ correctly
At the end of this article, we provide a solution --> set the version of Maven-compiler-plugin to 2.3.2. run to the POM of our project. the XML file shows that version 2.0.2 is set here and changed to 2.3.2. By the way, a new version of Maven is changed. The Maven repository is not managed, and then compiled. The problem is solved.

<plugin>  

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

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

<Version> 2.3.2 </version> <! -- Solve the build failure problem when a warning occurs -->

    <configuration>

    <source>1.6</source>

    <target>1.6</target>

<Encoding> UTF-8 </encoding> <! -- Solve the Problem of GBK ing error -->

    </configuration>

</plugin>  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.