首页 > 解决方案 > 未能执行目标 org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (attach-javadocs)

问题描述

我正在尝试安装使用 maven 构建 jar 文件的 CGView。命令是:

mvn package

但它给了我以下错误

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:58.749s
[INFO] Finished at: Tue Feb 23 16:07:13 IST 2021
[INFO] Final Memory: 28M/557M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (attach-javadocs) on project cgview: Unable to parse configuration of mojo org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar for parameter additionalOptions: Cannot assign configuration entry 'additionalOptions' with value '-Xdoclint:none' of type java.lang.String to property of type java.lang.String[] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException

我尝试使用以下方法删除 .m2/repository:

rm -rf ~/.m2/repository

但它仍然给了我同样的错误。我认为它必须与java环境有关。请指导。

这是我的 pom.xml 文件:

<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>ca.ualberta.stothard.cgview</groupId>
  <artifactId>cgview</artifactId>
  <packaging>jar</packaging>
  <version>2.0.2-SNAPSHOT</version>
  <name>cgview</name>
  <url>http://maven.apache.org</url>

  <properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-awt-util</artifactId>
      <version>1.13</version>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-dom</artifactId>
      <version>1.13</version>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-svggen</artifactId>
      <version>1.13</version>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-util</artifactId>
      <version>1.13</version>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-constants</artifactId>
      <version>1.13</version>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-xml</artifactId>
      <version>1.13</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.bluestemsoftware.open.maven.tparty</groupId>
      <artifactId>xerces-impl</artifactId>
      <version>2.9.0</version>
    </dependency>
    <dependency>
      <groupId>jargs</groupId>
      <artifactId>jargs</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>wso2-maven2-repository</id>
      <name>WSO2 Maven2 Repository</name>
      <url>http://dist.wso2.org/maven2</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
      </releases>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <compilerArgs>
            <arg>-Xlint:deprecation</arg>
            <arg>-Xlint:unchecked</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <additionalparam>-Xdoclint:none</additionalparam>
          <additionalOptions>-Xdoclint:none</additionalOptions>
          <additionalJOption>-Xdoclint:none</additionalJOption>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <archive>
            <manifest>
              <mainClass>ca.ualberta.stothard.cgview.CgviewIO</mainClass>
            </manifest>
          </archive>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

我的java版本是:

openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-1056-b12)
OpenJDK 64-Bit Server VM (build 25.152-b12, mixed mode)

谢谢

标签: javamavenpom.xml

解决方案


推荐阅读