我module
在官方文档中找到了该属性,maven-jdeps-plugin
其中指出
显示包含包的模块
- 类型:布尔值
- 自:JDK 1.9.0
- 要求:否
- 用户属性:jdeps.module
- 默认值:假
尝试以当前的最小值使用它,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
。
Q. 这个属性有什么用,怎么用?