Hello, everyone!
I’m trying to build a spring boot Atlassian connect plugin. I was able to do everything that I want on the spring boot basic project which I downloaded from atlassian connect spring boot repository. Now I’m trying to modify an existing spring boot project in order to perform the same operation on it. But I’m facing some issues. I’m not sure if they are relevant but I’ll try to list everything I noticed that has or may have an effect on the project.
1-) First of all, the spring boot project I’m trying to modify is generated by Jhipster. And has multiple other folders in resources folder. The folder layout is like:
By the way, as you can see I put the app descriptor in static folder. Otherwise, the application was throwing and didn’t start:
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/AbstractErrorController.class] cannot be opened because it does not exist
2-) When I run atlassian-sample project (the working one ) when I type the url produced by ngrok to the browser, it automatically redirects to atlassian-connect.json such as when I type https://acb63e8c.ngrok.io, it redirects to _https://acb63e8c.ngrok.io/atlassian-connect.json_. But in my application it was redirecting to Jhipster index.html. I had to add /atlassian-connect.json path myself at the end of the url. And another difference was the working application’s app descriptor looks like this on browser:
{
"key": "atlassian-connect-spring-boot-sample-basic",
"baseUrl": "https://acb63e8c.ngrok.io",
"name": "Atlassian Connect Spring Boot Basic Sample",
"authentication": {
"type": "jwt"
},
"lifecycle": {
"installed": "/installed",
"uninstalled": "/uninstalled"
}
}
Instead my new application’s app descriptor looks like plain text:
{ "key": "atlassian-connect-test-plugin", "baseUrl": "https://7385700d.ngrok.io", "name": "Atlassian Connect Test Plugin", "authentication": { "type": "jwt" }, "lifecycle": { "installed": "/installed", "uninstalled": "/uninstalled" }, "scopes": [ "read" ] }
3-) When I try to upload the plugin to Jira. Jira shows the message:
The app host returned HTTP response code 404 when we tried to contact it during installation. Please try again later or contact the app vendor.
I think the Lifecycle controller does not work.
4-) Besides when I try to autowire AtlassianHostRestClients the application throws an exception and does not start:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.connect.spring.AtlassianHostRestClients' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
I wrote just a simple service that does nothing.
@Service
public class JiraService {
@Autowired
private AtlassianHostRestClients atlassianHostRestClients;
}
Any help on these will be appreciated. Thanks in advance