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

lexicore
  • 42,748
  • 17
  • 132
  • 221

2 Answers2

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>`
0

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>
Amulya Koppula
  • 150
  • 1
  • 5