New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create an implementation project #1517

Closed
meribald opened this Issue Jun 21, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@meribald

meribald commented Jun 21, 2016

Hi, I am new to bndtools. I am trying to follow http://bndtools.org/tutorial.html#create-an-implementation-project.
My configuration: Eclipse Jee Mars with Bndtools plugin version 3.2.0.REL.
There is also a "Create an API project" section before the problematic section. I could follow it even though the tutorial is outdated.
The steps are very simple and I tried it many times as of now. I even downloaded a new Eclipse and installed bndtools again.
The steps are:

  1. File -> New -> Bnd OSGi Project
  2. Select Component Development template.
  3. Press Next.
  4. Give a name to the project.
  5. Press Finish.

Two default classes are created.One of them is Example.java which imports org.osgi.service.component.annotations.*, and uses @component annotation from that package. The other class is a test class that uses JUnit.
There are a lot of build errors after the project creation. For example, one of them is "The import org.osgi cannot be resolved".
I may be doing something wrong because the tutorial is not up-to-date, but I could not figure it out. Should I manually find the necessary jar files for org.osgi package and add it to the build path as an external jar? I suppose this should not be the case because it is not explained like that in the tutorial.

Thanks in advance for any help.

@meribald

This comment has been minimized.

Show comment
Hide comment
@meribald

meribald Jun 22, 2016

I found the problem. While creating the bnd workspace bndtools/workspace template should be selected. Previously, I tried with minimal workspace and osgi/workspace templates.
This adds some jars to the central repository.
I also want to add something about the Command component in the same tutorial for the ones who cannot follow the tutorial. bndlib artifact should be downloaded from the Maven repository (http://mvnrepository.com/artifact/biz.aQute.bnd/bndlib/2.4.0) and then added to the local repository. You can download the bndlib using the command:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=http://download.java.net/maven/3/ -Dartifact=biz.aQute.bnd:bndlib:2.4.0
Then you can drag and drop the downloaded jar to the Eclipse as explained in the 1st question here:
bndtools.org/faq.html

Also, you should not add 'osgi.cmpn' to the run requirements, otherwise you will get an error.

Sorry to bother you but for a newbie in bndtools this is frustrating.

meribald commented Jun 22, 2016

I found the problem. While creating the bnd workspace bndtools/workspace template should be selected. Previously, I tried with minimal workspace and osgi/workspace templates.
This adds some jars to the central repository.
I also want to add something about the Command component in the same tutorial for the ones who cannot follow the tutorial. bndlib artifact should be downloaded from the Maven repository (http://mvnrepository.com/artifact/biz.aQute.bnd/bndlib/2.4.0) and then added to the local repository. You can download the bndlib using the command:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=http://download.java.net/maven/3/ -Dartifact=biz.aQute.bnd:bndlib:2.4.0
Then you can drag and drop the downloaded jar to the Eclipse as explained in the 1st question here:
bndtools.org/faq.html

Also, you should not add 'osgi.cmpn' to the run requirements, otherwise you will get an error.

Sorry to bother you but for a newbie in bndtools this is frustrating.

@meribald meribald closed this Jun 22, 2016

@bjhargrave

This comment has been minimized.

Show comment
Hide comment
@bjhargrave

bjhargrave Jun 22, 2016

Member

Usage questions should be asked in the bndtools-users mail list. See https://github.com/bndtools/bnd#feedback.

Member

bjhargrave commented Jun 22, 2016

Usage questions should be asked in the bndtools-users mail list. See https://github.com/bndtools/bnd#feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment