[ https://jira.codehaus.org/browse/MDEP-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=311750#comment-311750 ]
Herve Boutemy edited comment on MDEP-124 at 10/18/12 1:28 AM: -------------------------------------------------------------- probably an explanation in the javadoc would be a first step, just to help people understand things the goal is missing (ie eveything that can't be detected at bytecode analysis level) Then it would be another task (another Jira issue) to enhance the way analysis is done to work on source instead of bytecode, which is another (more ambitious) approach than MDEP-122 = manually declare such exceptions was (Author: hboutemy): probably an explanation in the javadoc would be a first step, just to help people understand things the goal is missing (ie eveything that can't be detected at bytecode analysis level) Then it would be another task (another Jira issue) to enhance the way analysis is done to work on source instead of bytecode > Dependency incorrectly reported as "Unused declared" > ---------------------------------------------------- > > Key: MDEP-124 > URL: https://jira.codehaus.org/browse/MDEP-124 > Project: Maven 2.x Dependency Plugin > Issue Type: Bug > Components: analyze > Reporter: Olivier Dehon > Assignee: Brian Fox > Fix For: 2.6 > > > 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, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira