I've got a module without any explicit sources. This module contains the following cxf-codegen-plugin configuration:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<wsdlOptions>
<wsdlOption>
<wsdl>
${project.build.directory}/schema/wsdl/service.wsdl
</wsdl>
<bindingFiles>
<bindingFile>
${basedir}/src/main/resources/bindings.xml
</bindingFile>
</bindingFiles>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
So it is a dependency with generated classes. I need to export all the classes to other Java modules. Let's say, I need to export com.company.team.app
package. I tried adding it to module-info.java
but it doesn't compile because it says (which is valid actually):
module-info.java:[6,20] package is empty or does not exist: com.company.team.app
How do I export this classes then? Thank you very much!
The compile
phase comes after generate-sources
, so unless you see that error message before the compile
phase (that would be weird!), the sources are already generated.
Here's what I would do in your situation:
mvn clean compile
?mvn compile -X
and look out for the message block starting with "Source roots" - the folder needs to be mentioned there. (If it is not, add it.)