使用jenkins构建项目时报错:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.769 s
[INFO] Finished at: 2023-05-08T12:20:19Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project mybatis-encrypt-plugin: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - javadoc: warning - No source files for package com.st.test
[ERROR] javadoc: warning - No source files for package com.st.test.annotation
[ERROR] javadoc: warning - No source files for package com.st.test.encrypt
[ERROR] javadoc: warning - No source files for package com.st.test.utils
[ERROR] javadoc: error - No public or protected classes found to document.
[ERROR]
[ERROR] Command line was: /usr/lib/jvm/java-8-openjdk-amd64/jre/../bin/javadoc @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/tmp/test/mybatis-plugin/target/apidocs' dir.
[ERROR]
[ERROR] -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
原因是对javadoc检测时不通过,跳过即可:
mvn命令中添加以下属性:
-Dmaven.javadoc.skip=true
即:
mvn -U -DskipTests -Dmaven.javadoc.skip=true clean package