Announcement Announcement Module
Collapse
No announcement yet.
how can I import package from an other bundle project in eclipse Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how can I import package from an other bundle project in eclipse

    I create two bundle projects in my workspace, Service & Web bundle. but, in Web bundle, I can't import the packages which exported by service Bundle in the Web Bundle.

    I think the classpath includes only the 'repository/bundles' directory, not includes the 'stage' directory of AP.

  • #2
    how can I import package from an other bundle project in eclipse

    Hi Mark,

    Do you have project dependency setup in Eclipse between your Web and Service bundles?

    The AP tools only allow a bundle project to depend on bundles that are either:
    - in the target Platform's repository
    - or part of the same PAR
    - or listed in the project's project dependencies

    Regards,
    Andy

    Comment


    • #3
      how can I import package from an other bundle project in eclipse

      Hmm... actually I think the dependency between the project is added automatically (in the Bundle dependency container), when you have a correctly configured MANIFEST in both projects (that is: Both projects have the "bundle" nature in S2AP tooling and a MANIFEST and correct symbolic name / version settings), or has that changed recently?

      Regards
      Kay

      Comment


      • #4
        how can I import package from an other bundle project in eclipse

        Yes, it has changed: you'll now need to add a so-called Project Reference in Eclipse for bundle projects that are not in the same PAR file. The reason is that otherwise it becomes impossible to distuingish between multiple bundle projects that export the same packages within a single workspace. See also https://issuetracker.springsource.com/browse/PLATFORM-148 which triggered this change.

        Joris

        Comment


        • #5
          how can I import package from an other bundle project in eclipse

          hi all,
          I'm facing the same problem... i've tried to refactor the hello example from sam (migration path from war to par) after updating the tool suite to the latest version and the dm server to 1.0.0 rc2. The eclipse plugin could not resolve the import package hello.domain and hello.service... after that i tried to create two new project from scratch (domain and service) and tried to import the domin in the service package via export / import. But in the manifest-editor where the dependencies are defined there is no selection i can made if i click add in the import package section. I have set up a project dependency to the hello.domain project... but no change... what am i doing wrong...?

          kind regards,
          sandro

          Comment


          • #6
            how can I import package from an other bundle project in eclipse

            Hi Sandro,

            Just to clarify, you mentioned that you've set up a "project dependency". Did you simply select the other projects under the "Projects" tab of the Java Build Path for your project? If so, that is likely the issue.

            FYI: for anyone reading this, please note that having other projects on the Eclipse classpath (i.e., under the "Projects" tab of the Java Build Path) of a project is not equivalent to having a "Project Reference". A Project Reference is a different concept: to create a Project Reference, right-click on your project, select Properties, and then select the dependent projects in the "Project References" section.

            Hope this helps!

            Sam

            Comment


            • #7
              how can I import package from an other bundle project in eclipse

              Hi Sam,

              Yes, i've tried both ways... but i'm still not clear if this is the way it should be... :-) If I set up a project reference the way you mentioned shouldn't the package appear in the manifest-editor? And i still have errors in the IDE (not resolved types)... did i forget something important?

              Regards,
              Sandro

              Comment


              • #8
                how can I import package from an other bundle project in eclipse

                Hi Sandro,

                If you set up a project reference the way I mentioned, you should be able to get code completion for the Import-Package manifest header in the Bundle Manifest Editor for any packages exported by the referenced project.

                If you're still getting unresolved types, you might need to refresh/clean all related projects. Sometimes closing them and reopening them can help as well.

                Regards,

                Sam

                Comment


                • #9
                  how can I import package from an other bundle project in eclipse

                  Hi all,

                  Just for update... it was a problem of my toolsuite version... after upgrading it (to sts 1.1.1)... the problems went away... (thanks to christian)... :-)

                  greets,
                  Sandro

                  Comment

                  Working...
                  X