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

optionally import listed “dependency packages” for analyse-only

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      I’m working through the Spring Boot tutorial, and it uses packages like org.springframework.boot:spring-boot-starter-web that contain empty JARs but a lot of dependencies.

      Instead of doing…

                                                      <configuration>
                                                              <ignoredUnusedDeclaredDependencies>
                                                                      <!-- importers in Spring Boot -->
                                                                      <ignoredUnusedDeclaredDependency>org.springframework.boot:spring-boot-starter-test</ignoredUnusedDeclaredDependency>
                                                                      <ignoredUnusedDeclaredDependency>org.springframework.boot:spring-boot-starter-web</ignoredUnusedDeclaredDependency>
                                                              </ignoredUnusedDeclaredDependencies>
                                                              <ignoredUsedUndeclaredDependencies>
                                                                      <!-- imported by Spring Boot -->
                                                                      <ignoredUsedUndeclaredDependency>org.springframework:spring-context</ignoredUsedUndeclaredDependency>
                                                                      <ignoredUsedUndeclaredDependency>org.springframework.boot:spring-boot-test</ignoredUsedUndeclaredDependency>
                                                                      <ignoredUsedUndeclaredDependency>org.springframework:spring-web</ignoredUsedUndeclaredDependency>
                                                                      <ignoredUsedUndeclaredDependency>org.springframework.boot:spring-boot</ignoredUsedUndeclaredDependency>
                                                                      <ignoredUsedUndeclaredDependency>org.junit.jupiter:junit-jupiter-api</ignoredUsedUndeclaredDependency>
                                                                      <ignoredUsedUndeclaredDependency>org.springframework.boot:spring-boot-autoconfigure</ignoredUsedUndeclaredDependency>
                                                              </ignoredUsedUndeclaredDependencies>
                                                      </configuration>
      

      … or replacing them by the depended-on packages, for convenience (when the user does want to allow relaxing the dependency rules for this), there could be something like…

      <configuration>
        <importDependencyPackages>
          <importDependencyPackage>org.springframework.boot:spring-boot-starter-web</importDependencyPackage>
      […]
      

      … with which I’d whitelist one or more specific dependencies I have for “ignore if this one is unused” and “ignore if any of its dependencies are used but undeclared” (but no warning if (also explicitly) declared).

      Does this make sense?

      Attachments

        Activity

          People

            Unassigned Unassigned
            mirabilos Thorsten Glaser
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: