Skip to content

Added --allow-script-in-comments to javadoc config #318

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

Merged
merged 3 commits into from
Feb 7, 2017
Merged

Added --allow-script-in-comments to javadoc config #318

merged 3 commits into from
Feb 7, 2017

Conversation

nikarh
Copy link
Contributor

@nikarh nikarh commented Feb 6, 2017

Since Java 8u121, JavaScript is disabled in JavaDoc's by default (http://www.oracle.com/technetwork/java/javase/8u121-relnotes-3315208.html), failing build. To fix this JavaScript should be enabled explicitly with a flag --allow-script-in-comments.

Since Java 8u121, JavaScript is disabled in JavaDoc's by default (http://www.oracle.com/technetwork/java/javase/8u121-relnotes-3315208.html), failing build. To fix this JavaScript should be enabled explicitly with a flag --allow-script-in-comments.
@lutovich
Copy link
Contributor

lutovich commented Feb 7, 2017

Hi @nikarh!

Thanks for the contribution.

We build the driver only with Java 7 and run tests with both Java 7 and 8. So this javadoc problem is not an issue at this point. It also turns out that just adding allow-script-in-comments option will fail javadoc generation on all JDK versions prior to 1.8u121. Pull request build that uses Java 7u95 failed with this error:

Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project neo4j-java-driver: MavenReportException: Error while creating archive: 
Exit code: 1 - javadoc: error - invalid flag: --allow-script-in-comments

Command line was: /usr/lib/jvm/java-7-openjdk-amd64/jre/../bin/javadoc @options @packages

See these two issues for more details:

Not sure there is a good way to add --allow-script-in-comments to Maven javadoc plugin conditionally based on the JDK version. So suggest we add it to the pom like you did but commented out with a comment saying why it might be needed in future.

What do you think?

@nikarh
Copy link
Contributor Author

nikarh commented Feb 7, 2017

Hi, thank you for your reply.
I agree with leaving it in a comment for now. I will edit my pr now

@lutovich
Copy link
Contributor

lutovich commented Feb 7, 2017

@nikarh I think -- needs to be escaped in XML comments. Build failed with error:

Non-parseable POM: in comment after two dashes (--) next character must be > not a (position: END_TAG seen ...<!--<additionalparam>--a... @139:35)  @ line 139, column 35

@nikarh
Copy link
Contributor Author

nikarh commented Feb 7, 2017

@lutovich Thanks, this was somewhat unexpected. Would escaping it as <!--<additionalparam>&#45;&#45;allow-script-in-comments</additionalparam>--> be appropriate?
I believe in most IDE's commenting this line out would unescape it properly.

@lutovich
Copy link
Contributor

lutovich commented Feb 7, 2017

@nikarh yeah, this escaping looks a bit strange. Unescaping works in IntelliJ. Thanks again for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants