Details
-
Bug
-
Resolution: Fixed
-
Low
-
2.8.1
-
SDK Stash 2.8.1
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:
- Manage add-on admin pages shows warning message for plugin https://bitbucket.org/bolyuba/stash-block-pullrequest-addon/issue-attachment/8/bolyuba/stash-block-pullrequest-addon/1381835142.1/8/problem.png
- Logs indicate that class HttpServlet is missing https://answers.atlassian.com/upfiles/log_10.txt
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: