maven编译maven-javadoc-plugin错误问题解决

jdk1.8的打包报错如下,这是由于1.8下的doc生成机制问题

E:\studySoft\Java\jdk1.8.0_77\bin\java "-Dmaven.home=E:\studySoft\tools\JetBrains\IntelliJ IDEA 2016.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=E:\studySoft\tools\JetBrains\IntelliJ IDEA 2016.2\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port=7534 "-Didea.launcher.bin.path=E:\studySoft\tools\JetBrains\IntelliJ IDEA 2016.2\bin" -Dfile.encoding=UTF-8 -classpath "E:\studySoft\tools\JetBrains\IntelliJ IDEA 2016.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;E:\studySoft\tools\JetBrains\IntelliJ IDEA 2016.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.2 -s E:\studySoft\tools\apache-maven-3.3.9-bin\apache-maven-3.3.9\conf\settings.xml -Dmaven.repo.local=E:\studySoft\tools\Repository clean -P ci
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.neo:mouse-test-interface:jar:0.0.1-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-project-info-reports-plugin is missing. @ com.mouse:mouse-parent:0.0.1-SNAPSHOT, E:\studySoft\tools\Repository\com\mouse\mouse-parent\0.0.1-SNAPSHOT\mouse-parent-0.0.1-SNAPSHOT.pom, line 1216, column 12
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building mouse-test-interface 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The metadata E:\studySoft\tools\Repository\org\apache\maven\plugins\maven-javadoc-plugin\maven-metadata-mirrorId.xml is invalid: attribute value must start with quotation or apostrophe not M (position: START_DOCUMENT seen <!DOCTYPE html><html data-adblockkey=M... @1:38) 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.486s
[INFO] Finished at: Fri Jul 07 11:11:32 CST 2017
[INFO] Final Memory: 7M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-javadoc-plugin' from the repositories [local (E:\studySoft\tools\Repository), mirrorId (http://maven.aliyun.com/nexus/content/groups/public)]: Plugin not found in any plugin repository -> [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/PluginVersionResolutionException

Process finished with exit code 1

所以在pom里面的插件配置如下即可:

<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>
            <configuration>
                <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
        </execution>
    </executions>
</plugin>
    原文作者:吴世浩
    原文地址: https://www.jianshu.com/p/b7373d99f67d
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞