I have written Java-Classes with JavaDoc-commands that contain special characters like äöü
. I generate the JavaDoc using a gradle build-file:
apply plugin: 'java'
and the in the commandline: gradle javadoc
.
The encoding of the original files is UTF-8. The encoding of the JavaDoc files is also UTF-8. But there is no hint in the HTML-sources, that the files are UTF-8. Thats why my browser always thinks it is ISO-8859
.
How can I tell javadoc (via gradle) to also add <meta charset="utf-8"/>
to the source codes, when generating the JavaDoc?
Javadoc. Generates HTML API documentation for Java classes. If you create your own Javadoc tasks remember to specify the 'source' property! Without source the Javadoc task will not create any documentation. Example: plugins { id 'java' } task myJavadocs(type: Javadoc) { source = sourceSets.main.allJava }
org.gradle.jvmargs - specifies jvmargs used for daemon process. You want to set high enough memory limit to fix dex in Gradle process, so minimum configuration here is -Xmx2g , while 3-4 gigabytes won't hurt either.
In Gradle, Task is a single unit of work that a build performs. These tasks can be compiling classes, creating a JAR, Generating Javadoc, and publishing some archives to a repository and more. It can be considered as a single atomic piece of work for a build process.
You'll want to set the javadoc charset option.
javadoc { options.encoding = 'UTF-8' }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With