Fix yang-maven-plugin generating superfluous files 81/33081/1
authorRobert Varga <rovarga@cisco.com>
Wed, 20 Jan 2016 12:32:42 +0000 (13:32 +0100)
committerRobert Varga <rovarga@cisco.com>
Wed, 20 Jan 2016 12:36:20 +0000 (13:36 +0100)
commit0ff4283302f42d8c738bd6636d1ddd38a9018a35
tree53c210a45db2c67ba9f56ac886dd7544c6621ebf
parentf29f6b8445fae2505bce3feedfb3d005695adcdd
Fix yang-maven-plugin generating superfluous files

Logic detecting whether a file belongs to the current project has been
broken in change I75c8b67af01212a8ac5b832625f9405bb0108455. It works
most of the time with 'mvn clean install', but fails if there is a
generate-sources phase before dependency projects are
packaged/installed. This typically happens when invoked from IDE such as
Eclipse.

Perform correct checks to see if a particular file was injected from
current project.

The correct fix is to use SchemaContextResolver, where we inject local
files, capture their SchemaSourceIdentifiers, then inject any
dependencies. That way we can perform the lookup based on
ModuleIdentifiers and not rely on the particulars what form was used to
get the source.

Change-Id: I2392dc05bfbc94d613ec896d38fac21734a5bc81
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-maven-plugin/src/main/java/org/opendaylight/yangtools/yang2sources/plugin/YangToSourcesProcessor.java