I am using gradle to build my multi-module project. In one of my class, i have the following code segment.
private XMLSignatureFactory factory = XMLSignatureFactory.getInstance(
"DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());
But when i build this project using gradle, the compilation is getting failed with the following error message.
error: package org.jcp.xml.dsig.internal.dom does not exist
private XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());
But i have already verified that the above class is from rt.jar of JRE. I have tried with JDK 7 and 8.
What may be the root cause of the above issue?
Regards, Mayuran
I've encountered the same problem with you. And I solved by adding below configuration to build->maven-compiler-plugin.
It seems like maven can't find rt.jar in higher jdk version(for me the version is 1.8), so we need to configure explicitly.
I hope this will help you.