title: Incorrect results in mvn dependency:analyze
body: <p>I've been searching for a tool, which is able to show you unused dependecies. I soon stumbled over the maven command <code>mvn dependency:analyze</code>. The problem with this is, that it often detects "unused" dependencies which let the build fail if missing. </p>
  
  <p>Here is an example from an optimized Project:</p>
  
  <pre><code>$ mvn dependency:analyze
  
  [INFO] Building LogfileTool 0.1
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] &gt;&gt;&gt; maven-dependency-plugin:2.8:analyze (default-cli) &gt; test-compile @ LogfileTool &gt;&gt;&gt;
  [INFO]
  [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ LogfileTool ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 1 resource
  [INFO]
  [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ LogfileTool ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 7 source files to C:\Projects\LogfileToolMa\LogfileTool\target\classes
  [INFO]
  [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ LogfileTool ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory C:\Projects\LogfileToolMa\LogfileTool\src\test\resources
  [INFO]
  [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ LogfileTool ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO]
  [INFO] &lt;&lt;&lt; maven-dependency-plugin:2.8:analyze (default-cli) &lt; test-compile @ LogfileTool &lt;&lt;&lt;
  [INFO]
  [INFO] --- maven-dependency-plugin:2.8:analyze (default-cli) @ LogfileTool ---
  [WARNING] Unused declared dependencies found:
  [WARNING]    log4j:apache-log4j-extras:jar:1.2.17:compile
  [WARNING]    org.projectlombok:lombok:jar:1.16.18:provided
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  </code></pre>
  
  <p>Dependencies in Pom.xml</p>
  
  <pre><code>&lt;dependencies&gt;
  
  &lt;!-- Logger --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;log4j&lt;/groupId&gt;
    &lt;artifactId&gt;log4j&lt;/artifactId&gt;
    &lt;version&gt;1.2.17&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;log4j&lt;/groupId&gt;
    &lt;artifactId&gt;apache-log4j-extras&lt;/artifactId&gt;
    &lt;version&gt;1.2.17&lt;/version&gt;
  &lt;/dependency&gt;
  
  
  &lt;!-- Generating Getter, Setter etc. --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
    &lt;artifactId&gt;lombok&lt;/artifactId&gt;
    &lt;version&gt;1.16.18&lt;/version&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
    &lt;groupId&gt;commons-io&lt;/groupId&gt;
    &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
    &lt;version&gt;2.4&lt;/version&gt;
    &lt;type&gt;jar&lt;/type&gt;
  &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>The used Packages of Lombok are:</p>
  
  <pre><code>lombok.AccessLevel
  lombok.Data
  lombok.Getter
  lombok.Setter
  </code></pre>
  
  <p>By Removing lombok from my POM i get the following Error by Buildig the Project</p>
  
  <pre><code>-------------------------------------------------------------
  COMPILATION ERROR : 
  -------------------------------------------------------------
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[7,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[8,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[9,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[10,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[26,2] cannot find symbol
    symbol: class Data
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[13,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[14,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[15,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[16,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[26,2] cannot find symbol
    symbol: class Data
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[34,4] cannot find symbol
    symbol:   class Getter
    location: class  ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[35,4] cannot find symbol
    symbol:   class Setter
    location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[35,4] cannot find symbol
    symbol:   class Getter
    location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[36,4] cannot find symbol
    symbol:   class Setter
    location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[62,7] cannot find symbol
    symbol:   method setXmlToRead(java.lang.String)
    location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[63,7] cannot find symbol
    symbol:   method setPathToLogfiles(java.lang.String)
    location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[63,7] cannot find symbol
    symbol:   method setPathForStorage(java.lang.String)
    location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[64,7] cannot find symbol
    symbol:   method setPathToLogfile(java.lang.String)
    location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[93,50] cannot find symbol
    symbol:   method getPathToLogfiles()
    location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[95,100] cannot find symbol
    symbol:   method getXmlToRead()
    location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/Main.java:[61,51] cannot find symbol
    symbol:   method getPathToLogfile()
    location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/Main.java:[71,52] cannot find symbol
    symbol:   method getPathForStorage()
    location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  22 errors 
  -------------------------------------------------------------
  ------------------------------------------------------------------------
  BUILD FAILURE
  ------------------------------------------------------------------------
  Total time: 1.747 s
  Finished at: 2017-09-27T10:04:20+02:00
  Final Memory: 14M/210M
  ------------------------------------------------------------------------
  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project LogfileTool: Compilation failure: Compilation failure:
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[7,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[8,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[9,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[10,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[26,2] cannot find symbol
  symbol: class Data
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[13,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[14,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[15,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[16,14] package lombok does not exist
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[26,2] cannot find symbol
  symbol: class Data
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[34,4] cannot find symbol
  symbol:   class Getter
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[35,4] cannot find symbol
  symbol:   class Setter
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[35,4] cannot find symbol
  symbol:   class Getter
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[36,4] cannot find symbol
  symbol:   class Setter
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[62,7] cannot find symbol
  symbol:   method setXmlToRead(java.lang.String)
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileSearchConfig.java:[63,7] cannot find symbol
  symbol:   method setPathToLogfiles(java.lang.String)
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[63,7] cannot find symbol
  symbol:   method setPathForStorage(java.lang.String)
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/config_handler/LogfileParseConfig.java:[64,7] cannot find symbol
  symbol:   method setPathToLogfile(java.lang.String)
  location: class ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[93,50] cannot find symbol
  symbol:   method getPathToLogfiles()
  location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/log_handler/LogfileReader.java:[95,100] cannot find symbol
  symbol:   method getXmlToRead()
  location: variable logfileSearchConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileSearchConfig
  ch/glue/logfiletool/logfiletool/Main.java:[61,51] cannot find symbol
  symbol:   method getPathToLogfile()
  location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  ch/glue/logfiletool/logfiletool/Main.java:[71,52] cannot find symbol
  symbol:   method getPathForStorage()
  location: variable logfileToolConfig of type ch.glue.logfiletool.logfiletool.config_handler.LogfileParseConfig
  -&gt; [Help 1]
  
  To see the full stack trace of the errors, re-run Maven with the -e switch.
  Re-run Maven using the -X switch to enable full debug logging.
  
  For more information about the errors and possible solutions, please read the following articles:
  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  </code></pre>
  
  <p>And without log4j-extras i get following Error by running the Project</p>
  
  <pre><code>log4j:ERROR Could not instantiate class [org.apache.log4j.rolling.RollingFileAppender].
  java.lang.ClassNotFoundException: org.apache.log4j.rolling.RollingFileAppender 
  </code></pre>
  
  <p>Both log4j and lombok are used in my Project. Do you have an Idea how to fix this or where this is comming from?</p>
  
  <p>thank you in advance</p>