# How to send "-X" option to javadoc?

**URL:** <https://discuss.gradle.org/t/how-to-send-x-option-to-javadoc/23384>\
**Category:** Help/Discuss\
**Created:** [July 20, 2017, 11:02pm UTC](https://discuss.gradle.org/t/how-to-send-x-option-to-javadoc/23384 "2017-07-20T23:02:58Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Pierre1](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pierre1](https://discuss.gradle.org/u/Pierre1)\
**Post date:** [July 26, 2017, 11:37am UTC](https://discuss.gradle.org/t/how-to-send-x-option-to-javadoc/23384/4 "2017-07-26T11:37:56Z")

</div>

The `addStringOption('something')` as no effect on the javadoc properties, while `addStringOption('key', 'value')` works as expected. Command line options become `-key value`.

There was apparently an issue with non valued javadoc options, cause there is commit reverting it: [https://github.com/gradle/gradle/commit/a7da520ac4025cc38a47672de570a87990f9bca1](https://github.com/gradle/gradle/commit/a7da520ac4025cc38a47672de570a87990f9bca1)

Now, to add a -X option, we have to trick Gradle to make it accept our option as a key/value. But as you experienced yourself, the empty string will lead to an error. That’s why people add `-quiet`, this is a rather harmless option for the javadoc binary.

```gradle
javadoc {
    // without the -quiet option, the build fails
    options.addStringOption('Xdoclint:none', '-quiet')
}

```

I just tested on a small project with one class with badly designed javadoc:

- br tags `<br/>`
- Text making use of `<` and `>` such as `Collection<Foo>`
- unknown `@param` argument name
- undefined `@param` argument description

with Maven and Gradle. Both break the build without appropriate configuration. Both manage to generate something with the Xdoclint:none set. Resulting html is almost the same in both case with two differences only: Maven generates link to the Java public apidoc by default, and there is an additional link in the navigation bar: “use” linking to class-use folder.

---

_[View the full topic](https://discuss.gradle.org/t/how-to-send-x-option-to-javadoc/23384)._
