Spring Roo
  1. Spring Roo
  2. ROO-2720

Addon create command sets up Maven dependencies as bundle

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.5.RELEASE
    • Fix Version/s: 1.2.0.RELEASE
    • Component/s: @ RESOURCES, TESTING
    • Labels:
      None

      Description

      The "addon create" command sets up the addon's POM with several Roo dependencies. It generates these with <type>bundle</type>. This leads to Maven build errors during testing (exact cause not determined). Note that most OOTB addons don't declare these Roo dependencies as type=bundle.

        Activity

        Hide
        Stefan Schmidt added a comment -

        The <type>bundle<type> is needed so the Felix bundle plugin, which is installed in the created add-on pom.xml, can create a valid OSGi manifest. Without the bundle type definition of Roo dependencies for your add-on it would not be able to not be able to resolve imports correctly when loading your bundle in the Roo shell (Felix container). You can see a similar setup here http://stackoverflow.com/questions/375172/maven-osgi-bundles-and-multi-modules-projects.

        I'll adjust the title and issue type of this ticket to reflect the real problem here (testing of bundles managed by the Maven Felix plugin). The current setup is correct (not a bug) but not ideal as it appears to make testing harder.

        Assigning to Andrew our testing expert.

        Show
        Stefan Schmidt added a comment - The <type>bundle<type> is needed so the Felix bundle plugin, which is installed in the created add-on pom.xml, can create a valid OSGi manifest. Without the bundle type definition of Roo dependencies for your add-on it would not be able to not be able to resolve imports correctly when loading your bundle in the Roo shell (Felix container). You can see a similar setup here http://stackoverflow.com/questions/375172/maven-osgi-bundles-and-multi-modules-projects . I'll adjust the title and issue type of this ticket to reflect the real problem here (testing of bundles managed by the Maven Felix plugin). The current setup is correct (not a bug) but not ideal as it appears to make testing harder. Assigning to Andrew our testing expert.
        Hide
        Andrew Swan added a comment - - edited

        I don't think this ticket is anything to do with testing, so I've reverted its title to the original.

        My own manual testing indicates that it doesn't matter whether an addon's Roo dependencies are:

        • typed explicitly as "bundle" or implicitly as "jar"; the addon's manifest and other metadata files are identical in either case, and created addons work as expected.
        • scoped explicitly as "provided" or implicitly as "compile"; no Roo artifacts are packaged into the addon JAR file in either case, which is not surprising given that OSGi containers do not load enclosed artifacts onto the classpath in the way that a JEE server or servlet container would load JAR files enclosed in a WAR/EAR file.

        Git commit b6a31886c493965a894264caa44cfe4e33e1926a therefore removes the "type" and "scope" elements from all Roo dependencies for all addon types.

        Show
        Andrew Swan added a comment - - edited I don't think this ticket is anything to do with testing, so I've reverted its title to the original. My own manual testing indicates that it doesn't matter whether an addon's Roo dependencies are: typed explicitly as "bundle" or implicitly as "jar"; the addon's manifest and other metadata files are identical in either case, and created addons work as expected. scoped explicitly as "provided" or implicitly as "compile"; no Roo artifacts are packaged into the addon JAR file in either case, which is not surprising given that OSGi containers do not load enclosed artifacts onto the classpath in the way that a JEE server or servlet container would load JAR files enclosed in a WAR/EAR file. Git commit b6a31886c493965a894264caa44cfe4e33e1926a therefore removes the "type" and "scope" elements from all Roo dependencies for all addon types.

          People

          • Assignee:
            Andrew Swan
            Reporter:
            Rory Douglas
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: