Announcement Announcement Module
Collapse
No announcement yet.
import from classpath folder fails Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • import from classpath folder fails

    I upgraded to springIDE 2.0.3 and I am using import resource with classpath URL to load beans xmls.

    import only works if the resources folder containing the imported resource is used as a source folder in the eclipse project. If I add the resources folder as a class folder in the classpath of the project, the IDE does not find it, though the application runs fine.

    I also needed to import a beans xml from another project which is declared as a dependency of this current project, but the import gives an error.
    Tried both:
    - Adding the external class folder.
    - Adding the resources folder as the source folder in the other project (I did not try but from couple of forum threads it looks like that the beans xml inside a classpath jar does not work and this is similar situation)

    Only way I could make it work is by adding this external resources folder as a linked folder in the current project and then adding this linked folder as the source folder.

    Wanted to confirm if there is some cleaner way to make it work. I tried config set, that dint work either, perhaps because my beans xml are inside 'spring" sub-folder inside the resources folder and import statement reads:
    <import resource="classpath:spring/my-beans.xml"/>

  • #2
    Thanks for reporting this. Can you please raise a bug report in JIRA. We can follow on there.

    Christian

    Comment


    • #3
      Yeah! I need this as well. My project continues to grow significantly and would like to use the imported beans within the spring explorer view.

      Thanks for the great work!

      Comment


      • #4
        What JIRA entry was made?

        I'd like to track this as well.

        I'd like Spring IDE to follow imports into my maven dependencies, for example:

        <!-- Configure the JSR-311 JAX-RS implementation. -->
        <import resource="classpath:META-INF/cxf/cxf.xml" />
        <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
        <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

        Will that be possible?

        --Michael

        Comment


        • #5
          Following up with workarounds

          hi
          Following up for the benefit of all. (Sorry, forgot to do it earlier)

          I had opened the issue:
          http://jira.springframework.org/browse/IDE-838

          I have not tested with the latest releases but I see the issue is still open in jira.

          There are workarounds. The two cases that it does not work are:

          CASE 1)
          Including an XML which is in the same project:
          - Adding the parent folder to classpath does not work

          WORKAROUND for Case 1:
          =================
          Add the parent folder as a source folder of the eclipse project.

          Case 2)
          Including an XML which is in a dependency project:
          - Defining the project dependency when the dependency project exports the containing folder as classpath entry, does not work.
          - Defining the project dependency after adding the folder as the source folder of the dependency project does not work.
          - Adding the folder as an classpath folder does not work.
          WORKAROUND for Case 2
          ================
          In the dependent project, use eclipse's feature to create a folder as a link to original parent folder (in the dependency project).
          Now add this linked folder as a source folder of the dependent project.

          Comment

          Working...
          X