[ http://jira.codehaus.org/browse/MCOMPILER-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=240882#action_240882 ]
Dominique Jean-Prost commented on MCOMPILER-139: ------------------------------------------------ Well Benjamin, I think there may be indeed a problem in maven compiler, as the behaviour is different between mvn compile and mvn test-compile. I saw there are some opened bugs at oracle concerning @suppresswarnings("deprecation"), but as the behaviour is not the same between mvn compile and mvn test-compile, I think a problem might exists in the plugin. Can you check please ? > test-compile doesn't honor @SuppressWarnings("deprecation") as compile does > --------------------------------------------------------------------------- > > Key: MCOMPILER-139 > URL: http://jira.codehaus.org/browse/MCOMPILER-139 > Project: Maven 2.x Compiler Plugin > Issue Type: Bug > Affects Versions: 2.1, 2.3.2 > Reporter: Dominique Jean-Prost > Assignee: Benjamin Bentmann > Attachments: execution.log, test.zip > > > /test/src/main/java/test/DeprecatedObject.java : > [co...@deprecated > public class DeprecatedObject { > public DeprecatedObject() { > } > }[/code] > /test/src/main/java/test/DeprecatedMain.java : > [co...@suppresswarnings("deprecation") > public class DeprecatedMain { > @SuppressWarnings("unused") > private final Date d = new Date("20/10/2006"); > public DeprecatedObject test() { > return null; > } > }[/code] > /test/src/test/java/test/DeprecatedTest.java : > [co...@suppresswarnings("deprecation") > public class DeprecatedTest { > @SuppressWarnings("unused") > private final Date d = new Date("2010/2010"); > public void test(final DeprecatedObject obj) { > } > }[/code] > mvn clean test-compile : > [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ test --- > [INFO] Deleting C:\workspace\test\target > [INFO] > [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ test > --- > [WARNING] Using platform encoding (Cp1252 actually) to copy filtered > resources, i.e. build is platform dependent! > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ test --- > [WARNING] File encoding has not been set, using platform encoding Cp1252, > i.e. build is platform dependent! > [INFO] Compiling 2 source files to C:\workspace\test\target\classes > [INFO] > [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) > @ test --- > [WARNING] Using platform encoding (Cp1252 actually) to copy filtered > resources, i.e. build is platform dependent! > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ > test --- > [WARNING] File encoding has not been set, using platform encoding Cp1252, > i.e. build is platform dependent! > [INFO] Compiling 1 source file to C:\workspace\test\target\test-classes > [WARNING] \workspace\test\src\test\java\test\DeprecatedTest.java:[13,27] > [deprecation] test.DeprecatedObject in test has been deprecated > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > --> Although both DeprecatedMain and DeprecatedTest use DeprecatedObject and > both have @SuppressWarnings("deprecation") at class level, the compile output > shows a warning. The warning occurs only in test-compile. > Please note that if both stops using DeprecatedObject (remove te two "test" > method from objects), then copiler output doesn't mention deprecated. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira