--add-modules only on compilation [duplicate]

倖福魔咒の 提交于 2019-11-26 22:32:54

I made this answer a while ago where I answered this as an additional info to exposing non java.se packages in Java-9 using Maven.

The added part specifically focusses on using the standalone version of the java.xml.* APIs. To adapt to which you can probably start consuming the dependency on jaxb-api:2.3.0 which can be loaded as a module and can be executed from the classpath as well. The change you need to make is to add the following to your dependencies list:

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
</dependency>

This way you ensure migrating to standalone APIs for the module as well as moving away from a deprecated piece of code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!