Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-560

maven-dependency-plugin ignores method references passed as parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.0.0
    • 3.0.1
    • None
    • None

    Description

      I created example for commons-lang library https://gist.github.com/vdergachev/3dd0908ec0301b1e0357005e669cc726
      My applications contains few modules, in parent pom.xml i have regular entry

      <properties>
      <java.version>1.8</java.version>
      ...
      <properties>
      <dependencyManagement>
      <dependencies>
      ....
      <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
      </dependency>
      ...
      </dependencies>
      </dependencyManagement>
      

      in module's pom ONLY spring deps, so i don't have commons-lang library in module dependencies, but test runs fine. As you can see I passed reference StringUtils::isEmpty as a parameter to method. When part 2 uncommented and method StringUtils.isEmpty called directly in code i will have correct error message from maven-dependency-plugin

      [INFO] — maven-dependency-plugin:3.0.0:analyze-only (analyze-dependencies)
      [WARNING] Used undeclared dependencies found:
      [WARNING] commons-lang:commons-lang:jar:2.6:compile
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vladimir.dergachev Vladimir Dergachev
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: