@iragudo
Thanks for the follow up, based on your feedback I am much further along! I was able to get the project working in Eclipse by starting from scratch performing the following steps:
- Install M2E plugin for eclipse
- atlas-create-bitbucket-plugin
- atlas-create-bitbucket-plugin-module
- Eclipse: Import Existing Maven Project
Eclipse was able to locate the required Maven dependencies and compile the project.
It appears that with the Atlassian 8.0.7 SDK, the atlas-mvn command is deprecated. I seem to be running into many issues that are related to outdated documentation between 6.x and the new 8.x SDK.
This includes trying to use outdated tutorials like File Size Hook Example
In order to follow the example of using a DI constructor, I need to add a dependency for the CommitService.
private final CommitService m_commitService;
private final PluginCommandBuilderFactory m_commandFactory;
public MyFirstPrecommitHook(CommitService a_commitService, PluginCommandBuilderFactory a_commandFactory)
{
m_commitService = a_commitService;
m_commandFactory = a_commandFactory;
}
I get the following error when attempting to load the plugin:
[INFO] 2019-03-25 17:25:56,550 ERROR [spring-startup] c.a.p.manager.DefaultPluginManager There was an error loading the descriptor 'My First Precommit Hook' of plugin 'com.company.bitbucket.my-first-precommit-check'. Disabling.
[INFO] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.company.bitbucket.precommit.checks.MyFirstPrecommitHook': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.bitbucket.commit.CommitService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
[INFO] Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atlassian.bitbucket.commit.CommitService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
My next step was to attempt to use the @Component and the @Autowire annotations for my class and the constructor. However, Eclipse is now failing to recognize the spring-scanner annotations as being valid.
Are there any suggestions for how to update my Eclipse Maven Project to properly understand the spring scanner annotations?
Thanks for your help!