1

我有一个模块

module-info.java

--

module my.module.with.cxf.generated.packages {
    requires slf4j.api;
    requires spring.context;
    requires java.persistence;
    requires spring.beans;
    requires org.apache.cxf.core;
    requires java.xml;
    requires java.xml.bind;
    opens cxf.generated.package.no.one to my.other.module
    opens cxf.generated.package.no.two to my.other.module 
    exports cxf.generated.package.no.one to my.other.module
    exports cxf.generated.package.no.two to my.other.module
}

--

接着my.other.module

module-info.java

--

module my.other.module {
     requires my.module.with.cxf.generated.packages
}

--

我明白了

package cxf.generated.package.no.one is not visible

在编译代码时。我做错了什么?如何解决这个问题?

附加信息

IntelliJ IDEA 2020.3.1
Java 11
cxf-xjc-plugin 3.3.1
4

1 回答 1

1

因此,经过反复试验,我发现安排包以便在打开之前进行导出会产生编译结果

module my.module.with.cxf.generated.packages {
    requires slf4j.api;
    requires spring.context;
    requires java.persistence;
    requires spring.beans;
    requires org.apache.cxf.core;
    requires java.xml;
    requires java.xml.bind;
    exports cxf.generated.package.no.one to my.other.module
    exports cxf.generated.package.no.two to my.other.module
    opens cxf.generated.package.no.one to my.other.module
    opens cxf.generated.package.no.two to my.other.module 
} 
于 2021-01-21T00:39:06.170 回答