[YANGIDE-16] Can't find Yang models for import in Bundle artifacts, have to change it to jar Created: 21/May/16 Updated: 19/Oct/17 Resolved: 02/Jun/16 |
|
| Status: | Resolved |
| Project: | yangide |
| Component/s: | General |
| Affects Version/s: | unspecified |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | David M. Karr | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 5940 |
| Description |
|
Many of the available public Yang models for import, like "ietf-yang-types" and "ietf-inet-types" are in artifacts that default to type "Bundle". When YangIDE indexes the available imports using that artifact, it doesn't find any. If I just edit the properties of the dependency, changing the type from "bundle" to "jar", it will then find the available import files. It's awkward to have users perform the additional step to make the import files available. When YangIDE indexes artifacts, it checks for multiple different artifact types. When the artifact is of type "Bundle", it may not properly deal with it. For instance, a dependency search for "ietf-inet-types" finds artifacts in groupId "org.opendaylight.mdsal.model" which are of type "bundle" and also "xml, p2artifacts", whatever that means. There are also older artifacts in groupId "org.opendaylight.yangtools.model" that are of type "jar". If I select the old "jar" artifacts, the import files are found. If I select the newer "Bundle" artifact, it doesn't find the files. However, if I edit the dependency and change the type from "Bundle" to "jar", then it can find the import files. |
| Comments |
| Comment by David M. Karr [ 25/May/16 ] |
|
I now understand this problem a little better, and see a potential mitigation for it. In the "Add" dialog, the search results will list artifacts of type "bundle" if the "packaging" property is set to "bundle". It doesn't matter if the jar artifact has a valid OSGi manifest. The problem is, although m2e knows what a bundle is, compared to a jar, Maven only knows about bundles if the "maven-bundle-plugin" is enabled (with the "extensions" property set to "true", apparently). If that's not in place, Maven has no idea what to do with the artifact, so it says it can't find it. So, if we add the following to the pom.xml for the project, Maven will properly handle artifacts of type bundle: I'd like to do more research about the "extensions" property, and I'd like to see if the parent pom has a default version of the plugin that will work properly. |
| Comment by David M. Karr [ 02/Jun/16 ] |
|
The fix for this was merged with https://git.opendaylight.org/gerrit/#/c/39456/ . |