2017-10-13 63 views
4

的模块选项,我发现module属性上指出错误:未知的选项:-M同时使用maven-jdeps-插件

Show module containing the package

  • Type: boolean
  • Since: JDK 1.9.0
  • Required: No
  • User Property: jdeps.module
  • Default: false

试图利用它与该maven-jdeps-plugin的官方文档目前最小的pom.xml如下: -

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.7.0</version> 
      <configuration> 
       <source>9</source> 
       <target>9</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-jdeps-plugin</artifactId> 
      <version>3.1.0</version> 
      <configuration> 
       <apiOnly>false</apiOnly> 
       <failOnWarning>true</failOnWarning> 
       <module>true</module> 
      </configuration> 
      <executions> 
       <execution> 
        <goals> 
         <goal>jdkinternals</goal> <!-- verify main classes --> 
         <goal>test-jdkinternals</goal> <!-- verify test classes --> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

我的项目(命名为sparkjdk9)的基础上执行

mvn clean install 

结果到这些日志: -

[INFO] --- maven-jdeps-plugin:3.1.0:jdkinternals (default) @ sparkjdk9 --- 
[INFO] 
Error: unknown option: -M 
Usage: jdeps <options> <path ...>] 
use -h, -?, -help, or --help for a list of possible options 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.649 s 
[INFO] Finished at: ... 
[INFO] Final Memory: 13M/44M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jdeps-plugin:3.1.0:jdkinternals (default) on project sparkjdk9: 
[ERROR] Exit code: 2 
[ERROR] Command line was: /bin/sh -c '/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/jdeps' '-M' '.../sparkjdk9/target/classes' 

jdeps工具寻找进一步相似的标志,我可以看到错误是有道理的,因为在它的使用没有这样的标志-M

问:此属性的用法是什么?它如何使用?

回答

4

https://github.com/apache/maven-plugins/blob/trunk/maven-jdeps-plugin/src/main/java/org/apache/maven/plugin/jdeps/AbstractJDepsMojo.java#L322

曾经是模块参数的-M,但现在看来似乎已经在此期间被重命名为-m/--module

+0

不知道在哪里提出这个作为一个错误添加到跟踪器的插件来解决。另外,'-m /- 模块'在工具中,我可以看到用于指定用于分析的根模块。这是否也需要更改'Type'属性? (不知道什么是最初使用的构造) – nullpointer

+2

这将是issues.apache.org/jira/browse/MJDEPS –