In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to solve the problem that the.jar package cannot be generated when javadoc has compilation errors under maven:java8". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's take you to learn how to solve the problem that when javadoc has compilation errors under maven:java8, the.jar package cannot be generated.
Before has been compiled under java 7 maven project, encountered javadoc compilation prompt code comments have errors (such as invalid connection), can also generate javadoc jar package normally. However, recently changed the compiler to java 8, the same command execution, encountered javadoc compilation error, maven aborted execution, generation jar package failed.
Maven is not working in Java 8 when Javadoc tags are incomplete
This is due to Java 8 DocLint's new features:
Java 8 javadoc provides a new feature that allows programs to detect errors in java code comments (previous versions, javadoc callers could not detect errors in code comments). This feature is turned on by default, so maven will throw an exception when compiling javadoc.
The easiest solution: Upgrade maven-javadoc-plugin to version 3.0.0 or above and add none parameter to disable this feature
example is as follows
org.apache.maven.plugins
maven-javadoc-plugin
3.0.1
package
none
However, actual testing found that executing mvn javadoc:jar in this way is indeed effective, but when executing mvn release:prepare to prepare for the release version, there is no javadoc jar package generated. It is normal to use-Xdoclint:none instead of the doclint parameter:
org.apache.maven.plugins
maven-javadoc-plugin
3.0.1
package
-Xdoclint:none
After changing this, it is normal to execute mvn release:prepare under java 8, but it will report error: unsupported option-Xdoclint:none under java 7. So if you want release to work properly under Java 7 and Java 8, you need to use profile to distinguish JDK versions. Remove javadoc plugins added earlier in build/plugins and add profiles instead in pom.xml as follows:
....
doclint-java8-disable
[1.8,)
org.apache.maven.plugins
maven-javadoc-plugin
2.9
-Xdoclint:none
resources
Maven is not working in Java 8 when Javadoc tags are incomplete
maven javadoc-mojo
java 8 doclint
DocLint is a new feature in Java 8
How to ignore Maven build erros due to JavaDoc with Java 8
---------------------
At this point, I believe that everyone has a deeper understanding of "how to solve the problem that the.jar package cannot be generated when javadoc has compilation errors under maven:java8." Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.