Maven Javadoc'找不到默认的setter'并且失败了

时间:2015-07-22 13:27:07

标签: maven javadoc pom.xml

我正在尝试为maven项目生成javadoc,每次都遇到错误。
Unable to parse configuration of mojo org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc for parameter #: Cannot find default setter in class org.apache.maven.plugin.javadoc.options.Group。我正在使用的命令是根目录中的mvn javadoc:javadoc,其中pom是。

我根本没有配置任何组,或者根本没有任何特殊配置。我是否完全省略了我的pom中的插件,将其添加到报告或添加为构建插件,我得到了同样的错误。我也试过添加空组,虽然消息有所改变,但它仍然会出现。

我跑过this SO question但是一个。我没有TestNG依赖项,b。我没有使用命令行参数,而c。它从未得到解决。

这是一个Selenium项目,所以我想可能有类似的东西,但我无法弄清楚。有任何想法吗?我在下面包含了maven调试堆栈跟踪。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc (default-cli) on project Selenium: Unable to parse configuration of mojo org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc for parameter #: Cannot find default setter in class org.apache.maven.plugin.javadoc.options.Group -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc (default-cli) on project Selenium: Unable to parse configuration of mojo org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc for parameter #: Cannot find default setter in class org.apache.maven.plugin.javadoc.options.Group
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:220)
    ...
Caused by: org.apache.maven.plugin.PluginConfigurationException: Unable to parse configuration of mojo org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc for parameter #: Cannot find default setter in class org.apache.maven.plugin.javadoc.options.Group
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:605)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:537)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:119)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot find default setter in class org.apache.maven.plugin.javadoc.options.Group
    at org.eclipse.sisu.plexus.CompositeBeanHelper.setDefault(CompositeBeanHelper.java:95)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:61)
    at org.codehaus.plexus.component.configurator.converters.composite.AbstractCollectionConverter.fromChildren(AbstractCollectionConverter.java:54)
    at org.codehaus.plexus.component.configurator.converters.composite.ArrayConverter.fromConfiguration(ArrayConverter.java:57)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty(CompositeBeanHelper.java:273)
    at org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:210)
    at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:101)
    at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:32)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:575)
    ... 22 more

1 个答案:

答案 0 :(得分:2)

该错误消息表明配置程序无法将字符串转换为实例。而不是做像

这样的事情
<groups>
  <group>com.example</group>
  ...
</groups>

尝试将您的论坛重新设置为usage example

<groups>
  <group>
    <title>Core Packages</title>
    <!-- To includes java.lang, java.lang.ref,
    java.lang.reflect and only java.util
    (i.e. not java.util.jar) -->
    <packages>java.lang*:java.util</packages>
  </group>
  <group>
    <title>Extension Packages</title>
     <!-- To include javax.accessibility,
    javax.crypto, ... (among others) -->
    <packages>javax.*</packages>
  </group>
</groups>