Я работаю над проектом (весенняя загрузка), и мне нужно преобразовать XML-файл в классы Java с помощью плагина maven jaxb2. Я перехожу по этой ссылке: классы генерируются, проблема заключается в том, что когда я пытаюсь разобрать xml, у меня была эта ошибка: ресурс Resource ServletContext [/xsd/MX_sev_031_001_05. xsd] не существует, это мое приложение.Свойства:
context.path =xml.swift.spring.com
schema.location= xsd/MX_seev_031_001_05.xsd
это мой компонент конфигурации:
@Bean
public Jaxb2Marshaller createJaxb2Marshaller(@Value("${context.path}") final String contextPath,
@Value("${schema.location}") final Resource schemaResource){
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setContextPath(contextPath);
marshaller.setSchema(schemaResource);
Map<String, Object> properties = new HashMap<>();
properties.put(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.setMarshallerProperties(properties);
return marshaller;
файл xsd находится в папке src/main/resources/xsd, и это мой pom.xml:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.1</version>
<executions>
<execution>
<id>add-source-for-demoapp</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaDirectory>${project.basedir}/src/main/resources/xsd</schemaDirectory>
<schemaIncludes>
<include>*.xsd</include>
</schemaIncludes>
<!-- Other configuration options-->
</configuration>
</execution>
</executions>
what i'am missing?
Спасибо.