On 2018-05-18T16:50:56 +0100 org.apache.maven.u...@io7m.com wrote: > On 2018-05-18T17:01:52 +0200 > Andreas Sewe <s...@st.informatik.tu-darmstadt.de> wrote: > > > here's what I use as an <instruction> for the maven-bundle-plugin to > > generate a Bundle-License line in my MANIFEST.MF: > > > > > <Bundle-License>${project.licenses[0].url};description="${project.licenses[0].name}"</Bundle-License> > > > > > > > Works like a charm, as long as you have exactly one license. > > Looks good, thanks! > > You're also using it for the exact same reason I'd be using it. :)
Spoke a bit too soon. I'm using the bnd-maven-plugin, but I don't think that changes anything. I have: <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-maven-plugin</artifactId> <version>${io7m.bnd-maven-plugin.version}</version> <configuration> <bnd><![CDATA[ Bundle-Description: ${project.description} Bundle-License: ${project.licenses[0].name} ]]></bnd> </configuration> </plugin> Unfortunately, the resulting bundle manifest is: Bundle-Description Contract checking Bundle-License ${project.licenses[0].name} It seems that the array reference isn't being expanded. If I specify ${project.licenses}, I instead get: Bundle-License [org.apache.maven.model.License@3eba57a7] ... which is clearly the result of calling toString() on something that hasn't overridden it. Point is that the project.licenses property is definitely present, it's just that I'm unable to access any of the elements. -- Mark Raynsford | http://www.io7m.com
pgp8naM0lCYGF.pgp
Description: OpenPGP digital signature