-
Bug
-
Resolution: Unresolved
-
Medium
-
10.0.0
-
None
Case #1
Actual: if multiple fileGenerator sections are using same identifier then only one will be processed, the others will be ignored. the issue is caused by configuration data transformation from list to map, resulting part of configuration being lost
example (addresses org.opendaylight.yangtools.yang2sources.plugin.it.YangToSourcesPluginTestIT#testAdditionalConfiguration):
<plugin>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
<goal>generate-sources</goal>
</goals>
<configuration>
<yangFilesRootDir>../files</yangFilesRootDir>
<inspectDependencies>false</inspectDependencies>
<fileGenerators>
<fileGenerator>
<identifier>
org.opendaylight.yangtools.plugin.generator.api.TestFileGenerator
</identifier>
<configuration>
<nm1>abcd=a.b.c.d</nm1>
<nm2>abcd2=a.b.c.d.2</nm2>
</configuration>
</fileGenerator>
<fileGenerator>
<identifier>
org.opendaylight.yangtools.plugin.generator.api.TestFileGenerator
</identifier>
<configuration>
<c1>config</c1>
</configuration>
</fileGenerator>
</fileGenerators>
</configuration>
</execution>
</executions>
...
</plugin>
Expected: it should be possible to execute same file generator
Case #2
Actual: The file generation is executed for every FileGeneratorFactory implementation found in the classpath even if the FileGenerator identifier is absent in the configuration.
The issue is caused by incorrect logic within
org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor#instantiateGenerators,
where the main condition is factory existence, fileGenerator configuration for associated identifier is optional
Expected: file generation should be executed only for explicitly defined generators.
- split from
-
YANGTOOLS-747 Remove yang-maven-plugin-spi APIs
- Resolved