You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andre Tadeu de Carvalho (JIRA)" <ji...@apache.org> on 2019/01/22 18:08:00 UTC
[jira] [Commented] (MJDEPS-16) Include project dependencies in scan
[ https://issues.apache.org/jira/browse/MJDEPS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16748965#comment-16748965 ]
Andre Tadeu de Carvalho commented on MJDEPS-16:
-----------------------------------------------
Hi, people!
In order to really add this new feature, I had to change a considerable amount of code. And I have two considerations about this issue:
1) The jdeps commands below return different outputs:
jdeps -cp <Classpath items> <Project path>/target/classes/module-info.class
jdeps -cp <Classpath items> <Project path>/target/classes
jdeps --module-path <Classpath items> <Project path>/target/classes/module-info.class
jdeps --module-path <Classpath items> <Project path>/target/classes
2) jdeps -m fails if your target is <Project path>/target/classes/module-info.class. Example:
jdeps -m maven.its.base -jdkinternals <Project path>/target/classes/module-info.class
I suggest that this fix should go in the next major release.
Thanks,
> Include project dependencies in scan
> ------------------------------------
>
> Key: MJDEPS-16
> URL: https://issues.apache.org/jira/browse/MJDEPS-16
> Project: Maven JDeps Plugin
> Issue Type: New Feature
> Affects Versions: 3.1.1
> Environment: Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
> Maven home: /Users/aalmiray/.sdkman/candidates/maven/current
> Java version: 1.8.0_171, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre
> Default locale: en_CH, platform encoding: UTF-8
> OS name: "mac os x", version: "10.12.5", arch: "x86_64", family: "mac"
> Reporter: Andres Almiray
> Priority: Major
> Labels: up-for-grabs
> Time Spent: 10m
> Remaining Estimate: 0h
>
>
> 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:*
> {code:java}
> <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>
> {code}
> Output
> {code:java}
> $ 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] ------------------------------------------------------------------------
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)