maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Bentmann (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MCOMPILER-139) test-compile doesn't honor @SuppressWarnings("deprecation") as compile does
Date Mon, 25 Oct 2010 12:45:05 GMT

    [ http://jira.codehaus.org/browse/MCOMPILER-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=240883#action_240883
] 

Benjamin Bentmann commented on MCOMPILER-139:
---------------------------------------------

The difference between {{compile}} and {{test-compile}} is that those goals process different
sources, different input -> different output. Just enable debug logging, grab the cmd line
used to invoke {{javac}} and invoke it directly, it produces your warning, without any help
from Maven.

> 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 :
> [code]@Deprecated
> public class DeprecatedObject {
>     public DeprecatedObject() {
>     }
> }[/code]
> /test/src/main/java/test/DeprecatedMain.java :
> [code]@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 :
> [code]@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

        

Mime
View raw message