我有一个具有以下结构的项目:
parent
|-api
|-plugin (depends on api)
该项目是使用clean install package
父模块上的 Maven 任务构建的。JAR 可以正确生成,但 javadoc 不能正确生成。我怎样才能解决这个问题?
这是我的父模块的 pom 的样子:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>PluginLogger</groupId>
<artifactId>parent</artifactId>
<version>1.1</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<modules>
<module>plugin</module>
<module>api</module>
</modules>
// repositories and dependencies go here...
<build>
<defaultGoal>clean install package</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<configuration>
<outputDirectory>${project.build.directory}/javadoc</outputDirectory>
<sourceFileIncludes>
<include>**/me/suprB/pluginlogger/api/**/*.java</include>
</sourceFileIncludes>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
我只想为“api”模块生成Javadoc,而不是“插件”模块。