How to add Import-Package instructions for runtime dependencies?

前端 未结 1 909
忘掉有多难
忘掉有多难 2021-01-12 18:27

I\'m building an OSGi jar using Gradle, and I\'m having a bit of trouble with the manifest. Here\'s an excerpt from my build script:

apply plugin: \'java\'
a         


        
1条回答
  •  心在旅途
    2021-01-12 18:53

    I'm not familiar with the Gradle bnd plugin, but I am familiar with bnd.

    The default value of Import-Package in bnd instruction is *. The means: match against all of the generated imports. If you specify a single value for Import-Package then it overrides the * and becomes the sole import. Therefore your Import-Package instruction nearly always should end with a catch-all * in the last position.

    Taking a guess at how this would translate to Groovy/Gradle, I suggest the following:

    instruction 'Import-Package', 'org.springframework.orm', '*'

    0 讨论(0)
提交回复
热议问题