Stash 2.8.1: servlet api jar dependency cannot be found

Issue #8 resolved
Georgy Bolyuba created an issue

On Stash 2.8.1 it is impossible to enter license due to error while creating License Servlet component.

Question raised with atlassian support

Comments (8)

  1. Georgy Bolyuba reporter

    Looking at pom.xml of stash-parent, version 2.7.2:

                <!-- Dependency for OSGI exports. This version is available in plugins -->
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                    <version>2.5</version>
                </dependency>
                <!-- This version is available in core -->
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>javax.servlet-api</artifactId>
                    <version>3.0.1</version>
                </dependency>
    

    Same thing is in 2.8.1 pom.xml

  2. Georgy Bolyuba reporter

    When I build plugin with referencing stash-parent:2.7.2, my MANIFEST.MF have this in Import-Package section:

    javax.servlet;resolution:=optional,
    javax.servlet.http;resolution:=optional,
    

    However with stash-parent 2.8.1 this becomes

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

    Which seems to be the source of my problem

  3. Georgy Bolyuba reporter

    If plugin is packaged against 2.7.2, the only source for javax.servlet package on class path is:

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

    Manifest file of that dependency does not have OSGI tags, so when osgi Builder is trying to resolve version, it is set to null and manifest does not have version filter for that import item.

    With 2.8.1 both 2.5 and 3.0 serlet api jars are on the classpath. Builder while creating a manifest file sees both, but only 3.0 is an OSGI bundle. Processing that dependency (which should not be on classpath in the first place) modifies import packages in add-on's manifest

  4. Log in to comment