As per many blog and Stack Overflow posts, Java 11 does not include javax.xml.bind and javax.activation anymore like Java 8 used to. I’m therefore adding explicit dependencies for them to the project, where all of its other dependencies are specified, with scope compile. However, the project still fails to build, due to:
error: package javax.xml.bind.annotation does not exist
import javax.xml.bind.annotation.XmlElement;
error: package javax.xml.bind.annotation does not exist
import javax.xml.bind.annotation.XmlElementWrapper;
error: cannot find symbol @XmlElementWrapper(name = "errors")
error: cannot access DataSource mimeMessageHelper.addAttachment(attachment.getName(),attachment); class file for javax.activation.DataSource not found
I’m puzzled and can’t figure out where to correctly add the required dependencies so that it works. I suspect that this may have something to do with Java Module, JPMS? In this project, we don’t want to use modules. Is there nevertheless any special syntax required to “just add” JAXB and JAF dependencies?
It should be possible to easily reproduce the problem as follows:
It detected that out of the 42 dependencies that you assigned to the compile configuration in fineract-provider/dependencies.gradle, 74% of them (31) could be safely assigned to the implementation configuration instead.
The remaining 26% of those dependencies could/should be assigned to the api configuration instead of compile. These are those 11 api dependencies:
------------------------------------------------------------------------------
ABI Dependencies Summary (counts are approximate)
------------------------------------------------------------------------------
com.google.code.gson:gson:2.2.4, seen 430 time(s)
------------------------------------------------------------------------------
org.quartz-scheduler:quartz:2.1.7, seen 19 time(s)
------------------------------------------------------------------------------
joda-time:joda-time:2.4, seen 893 time(s)
------------------------------------------------------------------------------
org.apache.openjpa:openjpa-all:2.4.1, seen 10 time(s)
------------------------------------------------------------------------------
org.springframework:spring-jms:4.0.7.RELEASE, seen 6 time(s)
------------------------------------------------------------------------------
org.mnode.ical4j:ical4j:1.0.4, seen 3 time(s)
------------------------------------------------------------------------------
com.google.guava:guava:15.0, seen 3 time(s)
------------------------------------------------------------------------------
org.springframework:spring-context-support:4.1.9.RELEASE, seen 1 time(s)
------------------------------------------------------------------------------
org.springframework.security.oauth:spring-security-oauth2:2.0.4.RELEASE, seen 1 time(s)
------------------------------------------------------------------------------
com.squareup.retrofit:retrofit:1.6.1, seen 8 time(s)
------------------------------------------------------------------------------
com.sun.jersey:jersey-core:1.17, seen 418 time(s)
------------------------------------------------------------------------------