Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-3991

Stash dependency leaking into plugin dependencies

    XMLWordPrintable

Details

    Description

      Starting with version 2.8.1 (I think it should be 2.8.x, but I did not test with 2.8.0) this dependency is present on plugin classpath:

      <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
          <version>3.0.1</version>
      </dependency>
      

      As the result when plugin is packaged manifest ends with following item:

      javax.servlet;resolution:=optional;version="[3.0,4)",
      javax.servlet.http;resolution:=optional;version="[3.0,4)",
      

      However, this dependency cannot be found in runtime by OSGI container because the dependency that is visible to plugins is:

      <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <version>2.5</version>
      </dependency>
      

      This causes a error during plugin initialization.

      Steps to reproduce:

      • Created a plugin for Stash 2.8.1 and add one servlet component to it
      • Try to test it using SDK

      Expected result:

      • Plugin initialized properly

      Observed result:

      Work around:

      • Exclude dependency of stash-page-objects in pom.xml of the plugin
              <dependency>
                  <groupId>com.atlassian.stash</groupId>
                  <artifactId>stash-page-objects</artifactId>
                  <scope>provided</scope>
                  <exclusions>
                      <exclusion>
                          <groupId>javax.servlet</groupId>
                          <artifactId>javax.servlet-api</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
      

      More info can be found here:

      Attachments

        Activity

          People

            pepoirot Pierre-Etienne Poirot (Inactive)
            4d8760007b5c Georgy Bolyuba
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: