Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set encoding of Javadoc and CompileJava tasks to avoid relying on platform's default being UTF-8 #593

Closed
clydebarrow opened this issue Mar 12, 2019 · 4 comments

Comments

@clydebarrow
Copy link
Contributor

The presence of non-ascii characters in Javadoc annotations causes failures when executing the spring-restdocs-core:javadoc gradle task.

> Task :spring-restdocs-core:javadoc FAILED
/Users/clyde/dev/opensourceprojects/spring-restdocs/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonContentHandler.java:35: error: unmappable character for encoding ASCII
 * @author Mathias D??sterh??ft

The fix is to add options.encoding = 'UTF-8' to the javadoc closure in build.gradle.

@wilkinsona
Copy link
Member

Thanks. I guess I haven't seen this locally or on CI as they're using UTF-8 by default. We shouldn't rely upon that though.

@wilkinsona
Copy link
Member

While it's apparently only the javadoc task that breaks when the build's run with a non-UTF-8 encoding, we should set the encoding on the JavaCompile tasks too.

@clydebarrow
Copy link
Contributor Author

Fixed in #592

@wilkinsona
Copy link
Member

This needs to be fixed in all maintained branches so we'll need to handle it separately to #592. I'll take care of that and then we can rebase #592 on top.

@wilkinsona wilkinsona changed the title Javadoc task in gradle build fails on UTF-8 text Set encoding of Javadoc and CompileJava tasks to avoid relying on platform's default being UTF-8 Mar 13, 2019
@wilkinsona wilkinsona modified the milestones: 1.2.7.RELEASE, 2.0.4.RELEASE Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants