maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markku Saarela <markkusaar...@kolumbus.fi>
Subject Re: Can I skip these warnings and compile legacy classes in Maven?
Date Tue, 25 Aug 2009 05:35:22 GMT
Hi,

You can configure compiler plugin to use certain compiler version

http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html

also you can put additional target and source definitions in the same
compiler plugin configuration

http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

rgds,

Markku



Kevin wrote:
> I'm moving a legacy project into Maven2, but there're some classes
> using the SUN deprecated API which are not recommended now, so I get a
> failure message when running mvn compile.
>
> [ERROR] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Compilation failure
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\utility\CheckCode.java:[11,31]
> 警告:com.sun.image.codec.jpeg.JPEGCodec 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\utility\CheckCode.java:[12,31]
> 警告:com.sun.image.codec.jpeg.JPEGEncodeParam 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\utility\CheckCode.java:[13,31]
> 警告:com.sun.image.codec.jpeg.JPEGImageEncoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\side\Base64.java:[8,10]
> 警告:sun.misc.BASE64Encoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\side\Base64.java:[8,47]
> 警告:sun.misc.BASE64Encoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\side\Base64.java:[13,10]
> 警告:sun.misc.BASE64Decoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\side\Base64.java:[13,47]
> 警告:sun.misc.BASE64Decoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\utility\CheckCode.java:[133,2]
> 警告:com.sun.image.codec.jpeg.JPEGImageEncoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\utility\CheckCode.java:[133,29]
> 警告:com.sun.image.codec.jpeg.JPEGCodec 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\utility\CheckCode.java:[134,2]
> 警告:com.sun.image.codec.jpeg.JPEGEncodeParam 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\article\ad\Base64.java:[8,10]
> 警告:sun.misc.BASE64Encoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\article\ad\Base64.java:[8,47]
> 警告:sun.misc.BASE64Encoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\article\ad\Base64.java:[13,10]
> 警告:sun.misc.BASE64Decoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> D:\ideaprojects2\bbs\foo\src\main\java\bar\baz\article\ad\Base64.java:[13,47]
> 警告:sun.misc.BASE64Decoder 是 Sun 的专用 API,可能会在未来版本中删除
>
> and these classes wouldn't be compiled. Is there anyway that I can
> just ignore the warnings and succeed in compiling without replacing
> the codes?
>
> My JDK version:
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
>
> TIA.
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message