Search code examples
mavenintellij-ideajavadocmaven-javadoc-plugin

How to generate javadoc for some codes with persian characters?


There are some values for some fields which are hardcoded in my project. when I add maven javadoc plugin to my pom file, after "maven clean install" it gives the error :

unmappable character for encoding Cp1252
[ERROR] *?????º???? ?ª????????????????

Is there any way that javadoc doesn't give error for that?

Note: I have added this one to plugins:

              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <configuration>
                <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Solution

  • Finally I found the solution: One should add encoding to javadoc plugin configuration.

        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
            <encoding>UTF-8</encoding>
        </configuration>