JAXB2 Import: Could not process schema files (in28minutes udemy)
Asked Answered
T

2

0

I get a "could not process schema files" error on the <exception> line when I try to add the JAXB2 plugin...

pom.xml

    <plugins>
        <!-- JAXB2 Maven Plugin -->
        <!-- XSD Source Folder -->
        <!-- Java Class Source Folder -->
        <!-- clear folder -> false -->
    <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>xjc</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
                <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                <clearOutputDir>false</clearOutputDir>
            </configuration>
        </plugin>
    </plugins>

Screenshot of error:

enter image description here

Thoroughwort answered 18/4, 2019 at 18:48 Comment(6)
well.. what are the files in that directory?Motherless
It's only my application.properties file, which is blank by the way.Georas
Well if there's no schema files (.xsd) in that directory then no wonderMotherless
Um, so... how do I get something there? I've tried Maven Update Project...Thoroughwort
Please check the Maven console in Eclipse. Or run mvn clean install from the command line and post the output.Guillotine
Updating "node" and "npm" versions also can resolve this. According to current versions, <configuration> <nodeVersion>v16.14.0</nodeVersion> <nodeDownloadRoot>nodejs.org/dist/</nodeDownloadRoot> <npmVersion>8.5.2</npmVersion> </configuration> this helped me resolve issue.Intermixture
A
1

I faced similar problem just make sure xsd file has

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
</xsd:schema>

Not

<schema xmlns="http://www.w3.org/2001/XMLSchema">
</schema>`
Abscind answered 28/7, 2020 at 6:11 Comment(0)
I
1

For me, This issue is resolved by keeping <plugins></plugins> content inside <pluginManagement> tag as below,

<build>
<pluginManagement>
    <plugins> 
          <plugin>
           ...
          </plugin>
          <plugin>
           ...
          </plugin>
     </plugins>
</pluginManagement>
</build>
Intermixture answered 25/2, 2022 at 8:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.