Giter Club home page Giter Club logo

bnd's Introduction

bnd

GitHub release (latest SemVer) Rebuild CodeQL GitHub issues GitHub commit activity

bnd & bndtools

Bnd/Bndtools is a swiss army knife for OSGi. It creates manifest headers for you based on analyzing the class code, it verifies your settings, it manages project dependencies, diffs jars, and much more. At the core is a library with all the functions. The library is then used in a myriad of subsystems to provide the core functionality to the rest of the world.

  • bndlib and friends – The core library plus repository, resolve, etc.
  • maven plugins – A full set of maven plugins that make bnd useful for maven users
  • eclipse – Bndtools is the plugin for Eclipse that provides full GUI support for bnd. This is a p2 repository.
  • bnd – a command line utility with a hodgepodge of sometimes extremely useful functions. Can even be used instead of a build tool. is available through Homebrew formula.
  • gradle plugin(s) – A bnd workspace plugin that builds identical to Eclipse's bndtool as well as a gradle plugin that provides bnd support for non-workspace projects
  • ant – well ...

Feedback

Well, assuming you were born after 1970 you probably know how to file an issue? :-) We got a good record fixing bugs. However, to help us, it always works best if you can provide the smallest possible example as a github repo. If the bug is consistent we tend fix it really fast. At least specify the environment where the bug appears, we got lots of variants.

General feedback is of course also always welcome! The bnd discourse site mail list is open for any topic even remotely associated with bnd. And we even love to hear also how people use the product that takes so much of our time.

And the ones we love most are of course PRs! The documentation of bnd is fully included in this workspace. From a typo to a brilliant essay on Launchpad, submit a PR and we probably take it. Don't ask what bnd can do for you, ask what you can do for bnd!

License

This program and the accompanying materials are made available under the terms of the Apache License, Version 2.0 which is available at https://www.apache.org/licenses/LICENSE-2.0, or the Eclipse Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0.

API

We go out of our way to be backward compatible. There are thousands of extensive test cases and we use our own baselining tool to verify that we do not make gratuitious changes. Since this tool is part of Bndtools we often find out early enough that there are alternatives to breaking changes. We strictly follow OSGi semantic versioning. This means that we mark exported packages with a package version.

We try to keep major versions to a minimum but sometimes we must. This is clearly marked with a major release number.

The master branch is release 7 currently and the Java release version is 17. Since some libraries are used in the embedded world that have a slower uptake of the Java release train we keep a classic branch that continues a major release 6 on Java 1.8. The classic branch does not include the plugins.

Contributing

Want to work on Bnd/Bndtools? There are instructions to get you started. Please let us know if anything feels wrong or incomplete.

Some more instructions how to get started with bndtools development can be found here

Repo Structure

Branches

We have the following branches:

  • master – Where the work for the next release takes place. Pushes on this branch release to the snapshot repository
  • classic – A continuation of 6.4 compiled on Java 1.8 for the poor developers stuck in the limbo of 1.8 and 17.
  • next – Release branch to Maven central. Is used during the release process.

We generally do not use other branches. Issues and features are handled through PR's from forked repos.

Issues

Open issues are the one actively scheduled to go into the next milestone(s).

All other issues will be closed. However, some issues we close because we just lack people that are interested in working on them. We explicitly mark those issues with abeyance. If you got time to spare, do not hesitate to open them and indicate you're willing to work on them. We will then properly schedule and track them. If you need to find them, use this filter: is:issue label:abeyance, make sure is:open is not in the filter.

Milestones

We try to have a release every 3-6 months and plan these with milestones.

PRs

PRs should be submitted via another repo. After approval, they will be built to check for our requirements.

Actions

Actions trigger workflows depending on the branch. PR's for verification require approval when not from a known contributor. We verify the code quality with CodeQL and the contribution rules are also checked.

Using the latest development SNAPSHOT build of Bnd/Bndtools

All our artifacts are in the biz.aQute.bnd group id.

Bnd Gradle Plugins are finally released to the Gradle default repository as well. Bnd Maven Plugins are stored in the listed repos.

Bndtools requires a p2 repository and is therefore special:

Building

We use Gradle and Maven to build and the repo includes gradlew and mvnw at the necessary versions. We require at least Java 17.

  • ./gradlew :build - Assembles and tests the Bnd Workspace projects. This must be run before building the Bnd Maven and Gradle plugins.
  • ./gradlew :gradle-plugins:build - Assembles and tests the Bnd Gradle plugins.
  • ./mvnw install - Assembles and tests the Bnd Maven plugins.
  • ./gradlew :publish - Assembles and publishes the Bnd Workspace projects into dist/bundles.
  • ./gradlew :gradle-plugins:publish - Assembles and publishes the Bnd Gradle plugins into dist/bundles.
  • ./mvnw -Pdist deploy - Assembles and publishes the Bnd Maven plugins into dist/bundles.

Acknowledgments

YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.

Powered by Artifactory

YourKit

icons8 – For some of the icons

bnd's People

Contributors

amitjoy avatar bjhargrave avatar bosschaert avatar cdelg avatar chrisrueger avatar davemssavage avatar derheld42 avatar djencks avatar fhuberts avatar gamerson avatar jprinet avatar juergen-albert avatar jwahlman avatar kriegfrj avatar kwin avatar lefou avatar lostiniceland avatar maho7791 avatar njbartlett avatar paulbakker avatar pkriens avatar plabiausse avatar psoreide avatar rherrmann avatar rotty3000 avatar scottslewis avatar seanbright avatar stbischof avatar timothyjward avatar wborn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bnd's Issues

Quoting of run property has been lost

Previously empty values for run properties were quoted, so that they transferred as nulls into the runtime. This was useful for setting the "osgi.console" property to enable Equinox's built-in console.

The functionality has broken in the latest version; the empty value is unquoted and therefore disappears.

-donotcopy has no effect on files

It seems that -donotcopy is only matched against the directory names, not the file names. (Tried with 0.0.384 and 0.0.397, Win32, bnd Ant task.

Include cnf/ext/*.bnd automatically in bnd and also something like that for ant

bndtools makes changes in the cnf directory and updates the build.bnd file. This makes it hard for third parties or the owner of the workspace to extend the build.bnd file. For this reason, bnd should automatically include any bnd files in the cnf/etx/ directory.

Something similar could be envisioned for the ant file. Then again, I'd like to be able to live without ant ...

Improvide algorithm to calculate uses clause.

The uses clause could theoretically be restricted to just the types in the public/protected fields and method as well as public super class and public implemented interfaces. Currently, all references are used.

Question is if annotations are part of the uses or not ... I think so.

Can't call "ant clean"

The "clean" ANT task (and all other tasks besides "build") is inaccessible from the top-level build. As a result there is no obvious way to do a clean build.

Infos prints on System.out "Should not skip: ^"

bnd is logging through the System ouput this message. Is there a way to fix this by adding an exclude on this character or by using some logging facilities instead of using System.out ?

Bundle can't be found when custom BSN used

If the BSN of a bundle is customised, for example as follows:

-include: pom.xml
Bundle-SymbolicName: ${pom.groupId}.{$pom.artifactId}

Then the bundle cannot be found when referenced from elsewhere, e.g. in runbundles:

-runbundles: org.example.b1;version=latest,\
    org.example.b2;version=latest

Failed to use sub-interface as Service interface with @Component(provide= ...)

Problem description:
Define 2 eclipse projects. One containing an interface OneService exposed in a one.bnd. The other containing an interface TwoService and and interface OneTwoService extending OneService and TwoService all exposed in two.bnd.
In the second project create an implementation of OneTwoService and annotate it with @component(provide=OneService.class)

The problem now seen in eclipse is:
InheritanceTestTwoProject.two-impl: Service-ComponentComponent definition provides a class that is neither imported nor contained: be.test.oneservice.OneService

---- Code explaining the problem ----

--- ProjectOne ---

-- OneService --

package be.test.oneservice; public interface OneService { void printOne(); }

-- one-api.bnd --

Export-Package: be.test.oneservice;version=${Bundle-Version}
Bundle-Version: 0.0.0

--- ProjectTwo ---

-- TwoService --

package be.test.twoservice; public interface TwoService { void printTwo(); }

-- OneTwoService --

package be.test.twoservice; import be.test.oneservice.OneService; public interface OneTwoService extends OneService, TwoService { }

-- OneTwoServiceImpl --

package be.test.testservice.impl; import aQute.bnd.annotation.component.Component; import be.test.oneservice.OneService; import be.test.twoservice.OneTwoService; /*\* If the OneService interface is uncommented here, the bnd.bnd file can calculate the correct interfaces to import. _/ @component(provide=OneService.class) public class OneTwoServiceImpl implements /_OneService,*/ OneTwoService { public void printOne() { System.out.println("one"); } public void printTwo() { System.out.println("two"); } }

-- two-api.bnd --

Export-Package: be.test.testservice;version=${Bundle-Version} Bundle-Version: 0.0.0

-- two-impl.bnd --

Private-Package: be.test.testservice.impl Service-Component: be.test.testservice.impl.OneTwoServiceImpl Import-Package: be.test.oneservice,\ *

Detect redundant and missing imports

In our *.bnd files we don't use Import-Package: * catch-all, but rather list every imported package with proper version range. This way we can miss some import and also some imports can get redundant if the source changes. Bnd should therefore print warnings about such imports (Possibly redundant Import-Package and Possibly missing Import-Package). For possibly redundant imports there should be property to suppress warning per package, for example: Import-Package: com.example.mypackage; bnd-dynamic="true". This feature should be available also as API, because we are using Bnd embedded.

Export-Package of non-existing package could be reported too (if it is not not already like that).

Thanks in advance

Provide a way to specify the path to the cnf/ workspace

I'm forwarding this issue that is probably likely to happen more when using Bnd Tools than Bnd on its own, but I think it deserves some discussion.

https://github.com/njbartlett/bndtools/issues/#issue/56/comment/690061

Requiring the cnf/ workspace directory to be in the parent directory of the bundle is probably not a problem with most use-cases in Bnd, but in the case of development with BndTools, and with different Eclipse plugins collaborating, we can't always make it fit.

For instance, the EGit plugin clones repositories outside the workspace (in $HOME) by default, and doesn't copy projects into the workspace to let Git do its magic (history & everything). Instead, it just points to wherever the project lies, within the local Git repository. The requirement of having the cnf directory one directory above the bundle is not fitting with the default behavior proposed by EGit. Even if the Git repositories were cloned in the workspace, it would not work unless the repository is itself the bundle.

I think EGit isn't the only Eclipse plugin that is going to expect projects outside of the workspace, and that this problem is bound to happen more if BndTools gets more users.

OK, one answer could be that this is an Eclipse-centric problem and that Bnd shouldn't go out of its way to support it. However, it seems like there is a "transitive dependency" to support the workflows allowed with Eclipse projects.. Bnd Tools is a good opportunity to get more people to use Bnd... and Bnd is a good opportunity to get more people to package their bundles nicely ;-).

A solution would be to allow a property to be set to point to the path of the cnf repository. Bnd Tools could provide configuration to set this property to Bnd.

A workaround is described in the linked issue. We can live with it, but the devil is in the details, and this kind of issues may bite new users.

What do you think?

"packageinfo" or "package-info.java" ?

Not only but also inspired by the osgi-dev thread "Why default version for Export-Package is 0.0.0, not bundle version?" (see http://www.mail-archive.com/[email protected]/msg01514.html) I'm just a little bit confused about the bnd approach with the file naming "packageinfo".

The JLS (http://java.sun.com/docs/books/jls/third_edition/html/packages.html 7.4ff) already defines "package-info.java" for package relevant infos.

Wouldn't it be simplier (less complex) to have only one file for package definitions?

So, the bnd tool could manage the package version in "package-info.java", too.

Greetings from Germany
Oliver

@Reference in abstract super class not used

Steps to reproduce:

  1. Create an abstract class that implements a setter.
    Example: setLogService(LogService logService){ ... }
  2. Annotate the setter using the @reference annotation
  3. Create a class that extends the abstract class
  4. Annotate it using the @component annotation

Problem: The LogService isn't injected at OSGi runtime.

Download of git repo to Windows fails, because of colon in folder name

When I try to download this Git repository to windows (using TortoiseGit) it fails with an error message about a folder with a colon in it:

git.exe clone -v "git://github.com/bnd/bnd.git" "D:\Stijn\workspace\bnd"

Receiving objects: 100% (1486/1486), 60.39 MiB | 1.58 MiB/s
Resolving deltas: 100% (332/332)
Resolving deltas: 100% (332/332), done.
remote: Compressing objects: 100% (1149/1149)
remote: Compressing objects: 100% (1149/1149), done.
remote: Total 1486 (delta 332), reused 1063 (delta 140)
fatal: cannot create directory at 'biz.aQute.bndlib/test/maven-repo/org/apache/felix/maven-bundle-plugin/1.4.0-SNAPSHOT/maven-metadata-http:': Invalid argument

Creating a folder with a colon in it is not possible in Windows Explorer, neither can it be done from the command line. In both cases Windows will complain about the colon being an illegal character in a folder name. Maybe you can rename that folder so people on Windows can download as well?

Building bnd fails from a fresh checkout

Building from a fresh checkout of bnd fails as follows:

[javac] /Users/neil/Projects/bnd/biz.aQute.runtime/src/aQute/junit/runtime/BasicTestReport.java:26: cannot access java.lang.StringBuilder
[javac] class file for java.lang.StringBuilder not found
[javac]             System.out.println(test + " : ");
[javac]                                     ^

BUILD FAILED
/Users/neil/Projects/bnd/build.xml:5: The following error occurred while executing this line:
/Users/neil/Projects/bnd/cnf/build.xml:34: The following error occurred while executing this line:
/Users/neil/Projects/bnd/cnf/build.xml:52: Compile failed; see the compiler error output for details.

Seems the compilation classpath may not be configured correctly?

Bundles listed in runbundles should not be considered in build order calculation

If a bundle is listed in -runbundles it appears to be considered in the build order calculations. This can result in a CircularDependencyException when in fact no circular dependency exists.

For example I have bundles A and B, where B has a compilation dependency on A. My launcher is defined on bundle A because it is my "main" bundle, and I add B to the -runbundles for A because I want to include B when running the application.

To do this "properly" I have to create another bundle project that I just use as a launcher. This seems a little heavyweight, and is further reason IMHO to have separate and multiple launcher scripts, rather than including all launch information in bnd.bnd.

No Workspace found

If I add Bnd OSGi Project Nature, I get a dialog with:

Errors occurred during the build.
Errors running builder 'Bnd OSGi Builder' on project 'MySuperProject'.
java.lang.IllegalArgumentException: No Workspace found from: /home/martin/MySuperFramework/projects

The problem is that my projects are not directly in the Eclipse workspace directory.

aQute.launcher.Launcher$AllPermissionCollection.elements() returns empty enumeration

https://github.com/bnd/bnd/blob/master/biz.aQute.launcher/src/aQute/launcher/Launcher.java

The static initializer for AllPermissionCollection is missing an important line
to add AllPermission to the list of permissions. I think the static
initializer should look something like this:

    private static Vector<Permission> list = new Vector<Permission>();

    static {
            list.add(new AllPermission());
    }

Otherwise the following always returns an empty enumeration:

    public Enumeration<Permission> elements() {
            return list.elements();
    }

This is causing the secure tests to fail to launch when run in the IBM VM.
Apparently the IBM VM is using the elements() method to combine permissions where
the Oracle VM is not.

Allow Bnd class parser to report field constant values

Currently, when writing Bnd plugins (and when using the aQute.lib.osgi.ClassDataCollector), it is not possible to parse annotated fields constant values.

For instance, when parsing the following "MyAnnotation" custom annotation:

class Foo
{
@MyAnnotation
final static String FOO = "BAR";
}

it is not possible to parse the "BAR" value of the "FOO" constant.
that would be helpful if the Clazz.FieldDef class passed to the ClassDataCollector.field() method could be extended with this kind of data (the constant field value, if available).

NPE in Project.getSubBuilder(File)

This method now throws an NPE when the project has no sub builders, because the propertiesFile field of builder is null when the builder represents bnd.bnd itself.

NPE on line 1426 of Project.java

NullPointerException in the new code added for removing bnd.bnd output in the case of sub-builders. I have patched by inserting the following null-check:

 if( b.getPropertiesFile() != null && getPropertiesFile() != null && ...

aQute.lib.deployer.FileRepo does not support qualifiers

In class aQute.lib.deployer.FileRepo we have:
Pattern REPO_FILE = Pattern
.compile("([-a-zA-z0-9_.]+)-([0-9.]+|latest).(jar|lib)");
This pattern does not support qualifiers except by latest, but it is quite normal files including the qualifier (Ex: 1.0.0-RELEASE) at the repository.
Why do not use the class aQute.libg.version.Version?

Generated Service-Component header contains more than a list of filenames, but also parameters

NOTE: Had to remove '' from below because it was screwing up the formatting.

Using the following bnd configuration file:

Export-Package: org.example
Service-Component: org.example.TestComponent;Registry=java.rmi.registry.Registry

I get this as the manifest file:
Manifest-Version: 1.0
Service-Component: OSGI-INF/org.example.TestComponent.xml;Registry="ja
va.rmi.registry.Registry"
Bundle-Version: 0
Tool: Bnd-1.0.1
Bnd-LastModified: 1288196556553
Bundle-Name: BndTest
Bundle-ManifestVersion: 2
Created-By: 1.6.0_21 (Sun Microsystems Inc.)
Import-Package: org.example
Bundle-SymbolicName: BndTest

As you can see the Service-Component header contains the reference parameter Registry. I pulled the JAR file today and is marked as 1.0.1 (http://dl.dropbox.com/u/2590603/bnd/biz.aQute.bnd.jar, I believe was the link). The funny thing is that when I use the biz.aQute.bnd-1.0.1.jar from the bndtools project it works fine. In comparing the JAR files they are indeed different.

Bootstrapping problem in build

There seems to be a problem with bootstrapping bndlib when building bnd itself.

If you do "ant clean build" then the following exception is thrown:

/Users/neil/Projects/bnd/cnf/build.xml:74: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at aQute.bnd.build.ReflectAction.execute(ReflectAction.java:16)
    at aQute.bnd.build.Project.action(Project.java:1256)
    at aQute.bnd.ant.BndTask.execute(BndTask.java:41)
    ...
Caused by: java.lang.NoSuchFieldError: DEFAULT_CHARSET
    at aQute.lib.osgi.PreprocessResource.getBytes(PreprocessResource.java:18)
    ...

However if you subsequently just run "ant build" (i.e. without the clean) then it builds the rest successfully.

Provide a function to change a package and bundle version

Different users of bnd are doing special things to change the package and bundle versions. This requires relatively tricky code to change the bnd files (could be included files), Export annotation, and packageinfo. This should be centralized.

Rename cnf project to bnd

The cnf projects is too vaguely named. It should be called bnd to more closely align the project name with bnd.

Default Default Export package

If there is no version for an exported package bnd should use the bundle version for the export, without qualifier. This should generate a warning

Empty run properties cause NPE in launcher

If a run-property is given with an empty value, for example:

-runproperties: osgi.console=

This is translated by Project#getRunProperties() into a Map containing a null value. When launching, LauncherConstants#getProperties() attempts to transform this into a java.util.Properties object, but these are not permitted to contain null values, so an NPE is thrown. Stack trace as follows:

 java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:394)
    at java.util.Hashtable.putAll(Hashtable.java:466)
    at aQute.launcher.constants.LauncherConstants.getProperties(LauncherConstants.java:71)
    at aQute.launcher.plugin.ProjectLauncherImpl.writeProperties(ProjectLauncherImpl.java:78)
    at aQute.launcher.plugin.ProjectLauncherImpl.prepare(ProjectLauncherImpl.java:50)
    at bndtools.launch.OSGiRunLaunchDelegate.launch(OSGiRunLaunchDelegate.java:44)
...

Support for MetaType XML Generation

Hi,

Looking for BND to support MetaType generation. Is there a time line when this would be available?

Thanks for all your efforts,
Scott ES

RFE: Backslashes in ${somePath} causes problems on Windows

For example assume you have this in the bnd file, that you load with the bnd Ant task:

Include-Resource: META-INF=${basedir}/something/META-INF

This works fine on UN*X, but on Windows Ant will use the native Windows path format for basedir, and it seems bnd will try to interpret the backslashes in that as escapes, corrupting the path. This certainly occurs because you are using the Properties reader, which will interpret backslashes as escapes.

To solve this, interpolation could support something like ${var|antFiles}, where "|antFiles" indicates the the value is in the format that Ant uses for file lists, rather than in the format that bnd natively expects. This could escape backslashes, so that C:\temp becomes to C:\temp, etc.

Mapping of maven SNAPSHOT version

Need to think about how to map a maven SNAPSHOT version to a bundle version.

Currently a maven version such as 1.0.0-SNAPSHOT is mapped to 1.0.0.SNAPSHOT which at least means that the format is correct, but it doesn't help much with version progressions. I think perhaps this needs to be mapped to a timestamp such as 1.0.0.20110322-1200.

Source file location needed in error reports

When an error occurs I need to know the location of the error in the source file. Ideally this would be byte offset + length or end offset rather than line number, as there may be multiple errors per line.

OSGi Declarative Services, Component Reference, Target Parse Error for LDAP AND-Filter

copy from [equinox-dev]
http://dev.eclipse.org/mhonarc/lists/equinox-dev/msg06472.html

Hello Boeffi,

Thank you for your kind words about bndtools :-)

The ampersand does need to be escaped as & in the generated
component XML, to comply with normal XML rules. This sounds like a bug
in bnd's annotation processor, it should be escaping the string that
you provide via the annotation.

Please could you raise a bug against bnd via its issue tracker on
GitHub: http://github.com/bnd/bnd/issues

Until the problem is fixed, it should be possible workaround it by
simply writing & directly in the annotation property.

Regards,
Neil

On Sun, Oct 24, 2010 at 7:32 PM, cu@xxxxxxxxxx cu@xxxxxxxxxx wrote:

Hello from Germany,

this is my first post to this list. I hope you can help me or we can help us
together.

I get an IOException if I define a LDAP AND-Filter-Expression for selection
an appropriate target service (details see below):
...target='(&(test=A)(test2=B1))'

The problem is the boolean ldap-and-operator, the ampersand.

After adjusting the "&" to "& amp;" (without the white space) the parse error is gone as expected.
I'm not sure, but can this be the intention? Must the filter definition
(with the original LDAP syntax) adjusted to make it compatible to the xml
universum?

The component.xml was generated from my sources by the great Bndtools from
Neil Bartlett (a small advert ;-)
:
@reference(name="testRef",optional=true,dynamic=true,target="(&(test=A)(test2=B1))")
private void bind(ITest test, Map<String, ?> configuration) {...}

I'm pleased to read your suggestions?

cu
Boeffi

using the jars from helios 3.6.1

  • org.eclipse.osgi_3.6.1.R36x_v20100806.jar
  • org.eclipse.equinox.ds_1.2.1.R36x_v20100803.jar
  • org.eclipse.equinox.util_1.0.200.v20100503.jar
  • org.eclipse.osgi.services_3.2.100.v20100503.jar

copy'n'paste corrected for readability:

< component name='test.TestComponent' xmlns='http://www.osgi.org/xmlns/scr/v1.1.0' immediate='true' activate='activate' deactivate='deactivate' >
< implementation class='test.TestComponent' />

< reference name='testRef' interface='test.ITest' cardinality='0..1' bind='bind' unbind='unbind' policy='dynamic' target='(&(test=A)(test2=B1))' />

< reference name='testRef2' interface='test.ITest' cardinality='0..1' bind='bind2' unbind='unbind2' policy='dynamic' target='(test2=B2)' />

< /component>

osgi> !SESSION 2010-10-24 19:36:01.914

eclipse.buildId=unknown
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE

!ENTRY test.a.service 4 0 2010-10-24 19:36:01.916
!MESSAGE [SCR] Error occurred while opening component definition file
bundleentry://4.fwk724000057/OSGI-INF/test.TestComponent.xml
!STACK 0
java.io.IOException: [Line: 4, Pos: 169] ';' expected.
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.err(XMLParserImpl.java:1062)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.err(XMLParserImpl.java:1048)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parse_EntityRef(XMLParserImpl.java:978)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parse_attr_value(XMLParserImpl.java:303)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parse_attr(XMLParserImpl.java:357)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parse_attr_list(XMLParserImpl.java:389)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parse_tag_normal(XMLParserImpl.java:520)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parse_tag(XMLParserImpl.java:814)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parse_tag_normal(XMLParserImpl.java:545)
at org.eclipse.equinox.internal.util.xml.impl.XMLParserImpl.parseXML(XMLParserImpl.java:1100)
at org.eclipse.equinox.internal.util.xml.XMLParser.parseXML(XMLParser.java:95)
at org.eclipse.equinox.internal.ds.model.DeclarationParser.parse(DeclarationParser.java:107)
at org.eclipse.equinox.internal.ds.ComponentStorage.parseXMLDeclaration(ComponentStorage.java:87)
at org.eclipse.equinox.internal.ds.storage.file.FileStorage.loadComponentDefinitions(FileStorage.java:92)
at org.eclipse.equinox.internal.ds.SCRManager.startedBundle(SCRManager.java:586)
at org.eclipse.equinox.internal.ds.SCRManager.bundleChanged(SCRManager.java:234)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:919)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1349)
at
org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1300)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:380)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
at bndtools.launcher.BundleInstaller.performStarts(BundleInstaller.java:351)
at bndtools.launcher.BundleInstaller.performAllChanges(BundleInstaller.java:244)
at bndtools.launcher.BundleInstaller.synchronizeBundles(BundleInstaller.java:134)
at bndtools.launcher.BundleInstaller.run(BundleInstaller.java:85)
at java.lang.Thread.run(Thread.java:619)


equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev

BND calculates too many imported packages

In Lift (http://liftweb.net) we use BND (well, the Maven Bundle plugin) to create OSGi bundles for the Lift modules. There is one module (lift-util) that uses joda-time and actually only imports org.joda.time.DateTime, and ...Duration. But the bundle manifest created by BND calculates not only org.joda.time as imported package, but also org.joda.time.base.

If I exclude the superfluous package "manually" the bundle will be resolved just fine => It's a bug!

Support START_ACTIVATION_POLICY in Launcher

The Launcher needs to support an option to start bundles with the Bundle.START_ACTIVATION_POLICY flag. This is needed for launching Eclipse applications including Bndtools, because many Eclipse bundles have SWT code directly in their activators.

Bndtools Launcher had the ability to set a single defaultStart option for the launch but this could be overridden on a per-bundle basis:

bndtools.launcher.defaultStart=activationPolicy
-runbundles=org.eclipse.core.runtime,\
    org.foo;start=start,\
    org.bar;start=none

Admittedly I never used the per-bundle overrides myself, but somebody else may have done.

Move Annotations to lightweight jar

I want to annotate my packages with version numbers. My preferred way is adding aQute.bnd.annotation.Version to the "package-info.java" file.

Therefore I have to add a jar file to my dependencies containing those annotation(s). The only one i have found is

<dependency>
  <groupId>biz.aQute</groupId>
  <artifactId>bndlib</artifactId>
  <version>1.15.0</version>
  <scope>provided</scope>
</dependency>

But this jar file contains much more than needed. What about splitting the existing jar into (at least) two artifacts. One containing only the Annotations...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.