使用聚合生成javadoc时出错-无法写入临时文件-无法生成javadoc

dbf7pr2w  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(418)

我的项目有几个模块,它是用Java8编写的,我使用JDK11来构建。当我尝试使用 mvn javadoc:aggregate 我因以下错误而失败:

> Failed to execute goal
> org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:aggregate
> (default-cli) on project xyz: An error has occurred in Javadoc
> report generation: Unable to write 'options' temporary file for
> command execution

我在pom.xml中添加了如下配置的插件:

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>3.2.0</version>
      <configuration>
        <docencoding>UTF-8</docencoding>
        <splitindex>true</splitindex>
        <javadocExecutable>${JAVA_HOME}/bin/javadoc</javadocExecutable>
        <bootclasspath></bootclasspath>
        <reportOutputDirectory>${project.reporting.outputDirectory}/../../javadocs</reportOutputDirectory>
        <groups>
          <group>
            <title>web</title>
            <packages>com.xyz.a.b.*</packages>
          </group>
          <group>
            <title>logic</title>
            <packages>com.xyz.a.c.*</packages>
          </group>
          <group>
            <title>rest</title>
            <packages>com.xyz.a.d.*</packages>
          </group>
        </groups>
      </configuration>
      <executions>
        <execution>
          <id>javadoc</id>
          <goals>
            <goal>javadoc-no-fork</goal>
            <goal>jar</goal>
          </goals>
          <phase>process-resources</phase>
        </execution>
        <execution>
          <id>aggregate</id>
          <goals>
            <goal>aggregate</goal>
          </goals>
          <phase>site</phase>
          <configuration>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>

另外,在同一pom.xml中

<reporting>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.2.0</version>
    <reportSets>
      <reportSet>
        <id>aggregate</id>
        <configuration>
          <doclint>none</doclint>
        </configuration>
        <inherited>false</inherited>
        <reports>
          <report>aggregate</report>
        </reports>
      </reportSet>
      <reportSet>
        <id>default</id>
        <reports>
          <report>javadoc</report>
        </reports>
      </reportSet>
    </reportSets>
  </plugin>
</plugins>

对${project.reporting.outputdirectory}/../../javadocs目录的权限没有问题。你能帮我解决这个问题吗?你知道我可以检查什么来发现问题的原因吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题