You should use the -pluginpath.
cnf/build.bnd:
mavencentral:
https://repo.maven.apache.org/maven2
ossrh:
https://oss.sonatype.org/content/repositories/snapshots
-plugin:\
aQute.bnd.repository.maven.provider.MavenBndRepository;\
name="Maven Central";\
releaseUrl="${mavencentral}";\
snapshotUrl="${ossrh}";\
index="${.}/central.mvn";\
readOnly=true
cnf/central.mvn:
...
biz.aQute.bnd:biz.aQute.bndlib:5.2.0
foobar/src/foobar/Plugin.java
package foobar;
import aQute.bnd.osgi.Analyzer;
import aQute.bnd.osgi.EmbeddedResource;
import aQute.bnd.service.AnalyzerPlugin;
public class Plugin implements AnalyzerPlugin {
@Override
public boolean analyzeJar(Analyzer analyzer) throws Exception {
analyzer.getJar().putResource("hello", new EmbeddedResource("world", 0));
return false;
}
}
foobar/bnd.bnd
-buildpath: biz.aQute.bndlib;version='5.2.0'
Copy the JAR foobar.jar from generated to cnf/foobar.jar
cnf/build.bnd:
mavencentral:
https://repo.maven.apache.org/maven2
ossrh:
https://oss.sonatype.org/content/repositories/snapshots
-plugin:\
aQute.bnd.repository.maven.provider.MavenBndRepository;\
name="Maven Central";\
releaseUrl="${mavencentral}";\
snapshotUrl="${ossrh}";\
index="${.}/central.mvn";\
readOnly=true,\
foobar.Plugin
-pluginpath: ${.}/foobar.jar
If you rebuild foobar, you will see a 'hello' resource with 'world' as content. Remember to copy the JAR when you make changes tp the plugin.
You can put a project's generated jar on the -pluginpath but you tend to run quickly into problems that crater the build. Sounds convenient, but I remember that it wasn't.
We really need the External Plugins to be able to provide an AnalyzerPlugin ...
Hope this helps. Kind regards,
Peter Kriens
> To view this discussion on the web visit
https://groups.google.com/d/msgid/bndtools-users/CAO6F8YzHoxi6tj4_KTkDyLQdU%3DCF0hMQ8Xq00ODtyke%2BNDZVbg%40mail.gmail.com.