Uploaded image for project: 'Maven JDeps Plugin'
  1. Maven JDeps Plugin
  2. MJDEPS-16

Include project dependencies in scan

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1.1
    • Fix Version/s: None
    • Labels:
    • Environment:

      Description

       

      Version 3.1.1 executes jdeps on production (goal: jdkinternals) and test (goal: test-jdkinternals) sources but does not consider dependencies. This means the report will tell you if product sources are complaint or not but does not tell you if the packaged/deployed project would encounter problems or not.

      At the very least Compile/Runtime dependencies should be scanned. Please make this the default behavior. Perhaps it would be good to have a flag to skip this behavior if anyone would like to have the previous behavior.

      For reference, this issue was discussed with Robert Scholte during JCrete 2018.

      Minimum POM example:

      <project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>com.acme</groupId>
          <artifactId>sample</artifactId>
          <packaging>jar</packaging>
          <version>0.0.0-SNAPSHOT</version>
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-jdeps-plugin</artifactId>
                      <version>3.1.1</version>
                      <executions>
                        <execution>
                          <goals>
                            <goal>jdkinternals</goal>
                          </goals>
                        </execution>
                      </executions>
                  </plugin>
              </plugins>
          </build>
      
          <dependencies>
              <dependency>
                  <groupId>com.google.inject</groupId>
                  <artifactId>guice</artifactId>
                  <version>4.2.0</version>
              </dependency>        
              <dependency>
                  <groupId>com.google.guava</groupId>
                  <artifactId>guava</artifactId>
                  <version>25.1-jre</version>
              </dependency>
          </dependencies>
      </project>   
      

      Output

      $ mvn jdeps:jdkinternals
      [INFO] Scanning for projects...
      [INFO]
      [INFO] --------------------------< com.acme:sample >---------------------------
      [INFO] Building sample 0.0.0-SNAPSHOT
      [INFO] --------------------------------[ jar ]---------------------------------
      [INFO]
      [INFO] --- maven-jdeps-plugin:3.1.1:jdkinternals (default-cli) @ sample ---
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 0.506 s
      [INFO] Finished at: 2018-07-27T09:50:39+02:00
      [INFO] ------------------------------------------------------------------------
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aalmiray Andres Almiray
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m