You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dominique Jean-Prost (JIRA)" <ji...@codehaus.org> on 2010/10/21 17:16:32 UTC
[jira] Created: (MCOMPILER-139) test-compile doesn't honor
@SuppressWarnings("deprecation") as compile does
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.3.2, 2.1
Reporter: Dominique Jean-Prost
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
[jira] Commented: (MCOMPILER-139) test-compile doesn't honor
@SuppressWarnings("deprecation") as compile does
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ 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
[jira] Commented: (MCOMPILER-139) test-compile doesn't honor
@SuppressWarnings("deprecation") as compile does
Posted by "Dominique Jean-Prost (JIRA)" <ji...@codehaus.org>.
[ 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 :
> [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
[jira] Closed: (MCOMPILER-139) test-compile doesn't honor
@SuppressWarnings("deprecation") as compile does
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MCOMPILER-139.
---------------------------------------
Resolution: Not A Bug
Assignee: Benjamin Bentmann
Please report this against Oracle's {{javac}}, the Compiler Plugin merely forwards the warning message received from the compiler bundled with the JDK.
> 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
[jira] Commented: (MCOMPILER-139) test-compile doesn't honor
@SuppressWarnings("deprecation") as compile does
Posted by "Dominique Jean-Prost (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCOMPILER-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=240884#action_240884 ]
Dominique Jean-Prost commented on MCOMPILER-139:
------------------------------------------------
Well, you're right indeed.
Thank you for helping
> 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