Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectFactory not being compiled with newest version #253

Open
eric-a-braun opened this issue Apr 4, 2023 · 0 comments
Open

ObjectFactory not being compiled with newest version #253

eric-a-braun opened this issue Apr 4, 2023 · 0 comments
Labels

Comments

@eric-a-braun
Copy link

I am attempting to generate Java classes from an xsd schema using version 3.1.0 which is an upgrade where I am now using Java 17 and Spring boot 3

All classes generate to the specified location correctly (as .class), with the exception of the ObjectFactory being generated as a non-compiled .java file

Due to this happening my IDE is unable to resolve the ObjectFactory even though it exists (both through imports in separate projects and in the same project without an import as I was doing prior to upgrade)

Plugin setup (omitted package name, but everything else is included):

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <version>3.11.0</version>
   <configuration>
      <release>${java.version}</release>
   </configuration>
</plugin>
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <version>2.22.2</version>
</plugin>
<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>jaxb2-maven-plugin</artifactId>
   <version>3.1.0</version>
   <executions>
      <execution>
         <id>xjc</id>
         <goals>
            <goal>xjc</goal>
         </goals>
      </execution>
   </executions>
   <configuration>
      <xjbSources>
         <xjbSource>${basedir}/src/main/resources/xjb/bindings.xjb</xjbSource>
      </xjbSources>
      <sources>
         <source>${basedir}/src/main/resources/xsd/my-xsd.xsd</source>
      </sources>
      <outputDirectory>${project.build.directory}/generated-sources/xjc</outputDirectory>
      <packageName>com....</packageName>
   </configuration>
</plugin>
<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>build-helper-maven-plugin</artifactId>
   <version>3.3.0</version>
   <executions>
      <execution>
         <id>add-source</id>
         <phase>generate-sources</phase>
         <goals>
            <goal>add-source</goal>
         </goals>
         <configuration>
            <sources>
               <source>${project.build.directory}/generated-sources/xjc</source>
            </sources>
         </configuration>
      </execution>
   </executions>
</plugin>

Here is a screenshot of the ide not finding the ObjectFactory:
image

And a snapshot of the target directory that I am generating files to:
image

I submitted a report to IntelliJ/JetBrains and they stated that the issue seems to be with the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants