You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brian Fox (JIRA)" <ji...@codehaus.org> on 2010/09/13 03:10:32 UTC
[jira] Commented: (MDEP-124) Dependency incorrectly reported as
"Unused declared"
[ http://jira.codehaus.org/browse/MDEP-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235024#action_235024 ]
Brian Fox commented on MDEP-124:
--------------------------------
The analyzer walks all classes and collects the list of imports essentially and then tries to mark dependencies when it finds an imported class in that dependency. There is no processing of the annotations or constants in the analyzer since it's looking purely at the bytecode. The best we can do here is allow you to annotate the configuration with a list of artifacts that should be ignored.
> Dependency incorrectly reported as "Unused declared"
> ----------------------------------------------------
>
> Key: MDEP-124
> URL: http://jira.codehaus.org/browse/MDEP-124
> Project: Maven 2.x Dependency Plugin
> Issue Type: Bug
> Components: analyze
> Reporter: Olivier Dehon
> Assignee: Brian Fox
>
> When a dependency is only required for a constant in a JAR, dependency:analyze incorrectly reports the dependency as "Unused declared".
> Example:
> Constants.jar has 1 class called Constants.java:
> {code}
> package com.myco.util;
> public class Constants
> {
> private Constants() {};
> public static final double PI = 3.14159;
> }
> {code}
> Then App jar has App.java as:
> {code}
> package com.myco.app;
> public class App
> {
> public static void main( String[] args )
> {
> System.out.println( com.myco.util.Constants.PI );
> }
> }
> {code}
> Since the constant gets optimized away in the generated {{App.class}}, the dependency is not detected, even though the project won't compile without it.
--
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