PullRequestService initialization

I thought I would build a Bitbucket server plugin with a REST interface that allows me to get a count of all merged Pull Requests in a project… but can’t figure out how to initialize the PullRequestService.

Much googling yielded no results.

It’s rather difficult to say without more context around how you’re trying to get it to work and what the failure or error looks like.

I’d imagine that most people here in this forum are using Spring Scanner: https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/

I have followed the instructions for setting up Spring Scanner but I am missing something because I am getting error messages about packages that do not exist:

… package com.atlassian.plugin.spring.scanner.annotation.imports does not exist

I added that import to support the constructor looking like:

public pullreq(@ComponentImport PullRequestService pullRequestService)

Using a project I found in Github that uses ComponentImport, I found an error in my pom.xml and got rid of the import problem.

I had put the dependency for the scanner inside the dependencyManagement section.