自从我使用Maven以来,我已经能够在本地存储库中构建并安装具有不完整Javadoc标记(例如,缺少参数)的项目。
但是,由于我迁移到Java 8(1.8.0-ea-b90),因此Maven对缺少文档标签的要求绝对严格,并在尝试构建或安装Javadoc不在其中的项目时向我展示许多与Javadoc问题有关的Javadoc错误。 “完善”。我试图编译并安装在本地存储库中的某些项目是我无法控制的第三方项目。因此,在我的情况下,仅修复所有这些项目中的所有Javadocs的变通办法似乎不可行。
这是我mvn clean package install
在项目中执行时看到的输出的一小部分:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.026s
[INFO] Finished at: Mon Apr 08 21:06:17 CEST 2013
[INFO] Final Memory: 27M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9:jar (attach-javadocs) on project jpc: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - /Users/sergioc/Documents/workspaces/heal/jpc/src/main/java/org/jpc/engine/prolog/PrologDatabase.java:10: error: @param name not found
[ERROR] * @param terms the terms to assert
[ERROR] ^
[ERROR] /Users/sergioc/Documents/workspaces/heal/jpc/src/main/java/org/jpc/engine/prolog/PrologDatabase.java:11: warning: no description for @return
[ERROR] * @return
[ERROR] ^
在我的POM中,Javadoc Maven插件的配置如下:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
如前所述,如果我回到Java 7,一切都会正常运行,也许这是与Java 8中运行的Maven有关的bug?如何使用Java 8使其工作(即能够构建项目的Javadoc并将其代码安装在本地存储库中)?我已经在OSX中使用Maven 3.0.3和3.0.5进行了测试。
更新:
如果我用<failOnError>false</failOnError>
(感谢Martin)更改Javadoc插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
然后将项目安装在我的本地存储库中。但是,仍未生成Javadoc JAR。
我在控制台中看到的带有此新配置的输出片段是:
[错误] MavenReportException:创建归档文件时出错:退出代码:1-/Users/....java:18:警告:否@param ...命令行为:/ Library / Java / Home / bin / javadoc @options @包装
请参考“ / Users / sergioc / Documents / workspaces / heal / minitoolbox / target / apidocs”目录中生成的Javadoc文件。
在org.apache.maven.plugin上org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeReport(AbstractJavadocMojo.java:1990)上org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeJavadocCommandLine(AbstractJavadocMojo.java:5043) org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)的.javadoc.JavadocJar.execute(JavadocJar.java:181)org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java :209),位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153),位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145),位于org.apache。位于org.apache.maven.lifecycle.internal.LifecycleModuleBuilder的maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)。org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)的org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)的buildProject(LifecycleModuleBuilder.java:59)在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)在org.apache.maven.cli.MavenCli.execute(MavenCli.java :537)在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)在org.apache.maven.cli.MavenCli.main(MavenCli.java:141)在sun.reflect.NativeMethodAccessorImpl.invoke0(位于java.lang.reflect.Method处的sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)处的本机方法(NativeMethodAccessorImpl.java:57)。在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)处调用(Method.java:491)在org.codehaus.plexus.classworlds.launcher.Launcher.launch增强(Launcher.java:290)在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
关于如何构建源代码,安装项目以及在与Java 7一起工作的一步中生成Javadoc JAR的任何变通办法?