[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-dev] why can't I access org.osgi.resource package from org.eclipse.osgi-3.10.0.v20140606-1445 from a mojo?

Hi devs,

I'm developing a plugin to specifically work with tycho based buildings. I
need have access to interfaces of org.osgi.resource package, but I'm not being able to do that and I don't know why.

The annoying thing is that I can access classes from org.osgi.framework. package.

CodeSource srcb = Bundle.class.getProtectionDomain().getCodeSource();
ÂÂÂÂÂÂÂ if (srcb != null) {
ÂÂÂÂÂÂÂÂÂ URL jar = srcb.getLocation();
ÂÂÂÂÂÂÂÂÂ getLog().info("Bundle loaded from " + jar);

Bundle loaded from file:/home/cvgaviao/.m2/repository/org/eclipse/tycho/org.eclipse.osgi/3.10.0.v20140606-1445/org.eclipse.osgi-3.10.0.v20

But when I tried this:
CodeSource srcr = Resource.class.getProtectionDomain().getCodeSource();
ÂÂÂÂÂÂÂ if (srcr != null) {
ÂÂÂÂÂÂÂÂÂÂÂ URL jar = srcr.getLocation();
ÂÂÂÂÂÂÂÂÂÂÂ getLog().info("Resource loaded from " + jar);

gives me an exception: ÂA required class was missing while executing o.l.t.m.rx:o.l.t.m.rx.plugin:0.2.1-SNAPSHOT:generateIndex: org/osgi/resource/Resource

could someone give a light here, please ?



GIF image