如何抑制从父 pom.xml 运行 maven-javadoc-plugin?
Posted
技术标签:
【中文标题】如何抑制从父 pom.xml 运行 maven-javadoc-plugin?【英文标题】:How to supress maven-javadoc-plugin run form parent pom.xml? 【发布时间】:2021-09-22 10:57:21 【问题描述】:我有一个 pom.xml https://repo1.maven.org/maven2/com/miglayout/miglayout-swing/5.2/miglayout-swing-5.2.pom
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-parent</artifactId>
<version>5.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>miglayout-swing</artifactId>
<packaging>jar</packaging>
<name>MiGLayout Swing</name>
<description>MiGLayout - Java Layout Manager for Swing</description>
<dependencies>
<dependency>
<groupId>$project.groupId</groupId>
<artifactId>miglayout-core</artifactId>
<version>$project.version</version>
</dependency>
</dependencies>
</project>
有了这个来源https://repo1.maven.org/maven2/com/miglayout/miglayout-swing/5.2/ 我收到以下错误:
INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52.475 s
[INFO] Finished at: 2021-07-13T14:12:16+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.0:jar (attach-javadocs) on project miglayout-swing: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
[ERROR] javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
请告诉我如何完全关闭 maven-javadoc-plugin?我需要在没有 javadoc 的情况下构建这个项目。 谢谢
【问题讨论】:
【参考方案1】:您可以将属性maven.javadoc.skip
设置为true
,即在您的<properties>
部分添加类似
<maven.javadoc.skip>true</maven.javadoc.skip>
【讨论】:
谢谢,它有效!你能告诉我如何跳过目标 org.apache.maven.plugins:maven-gpg-plugin:1.6:sign goal 吗?gpg.skip
。见maven.apache.org/plugins/maven-gpg-plugin/sign-mojo.html以上是关于如何抑制从父 pom.xml 运行 maven-javadoc-plugin?的主要内容,如果未能解决你的问题,请参考以下文章
无法从父 pom.xml 解析子 pom.xml 中的 $project.version
如何在 Maven 中从 pom.xml 调用 testng.xml 文件