Confluence 自定义宏未显示在宏浏览器中
Confluence custom macro doesn't show up in Macro Browser
我正在关注官方 tutorial 关于为 confluence 5.9.7 版编写自定义宏的内容。我从教程中唯一改变的是插件名称和包名称,您可以在我附加的文件中看到它们。 运行ning altas-run.bat后,在Confluence的系统配置页面可以看到插件已经成功安装并启用,两个模块都有。但是当我试图在页面中插入这个宏时,我在宏浏览器中找不到它。
然后我在完全相同的步骤中按照另一个教程 writing a plugin with JSON 进行操作,一切都和上一个一样正常,但仍然无法在宏浏览器中找到宏。我在这个问题上花了好几个小时,真的受够了。
ExampleMacro.java
在包 com.example.api
下。与教程中编写的代码相同。下面是插件描述文件。 pom 由 运行ning atlas-create-confluence-plugin.bat 自动生成。除了 confluence 版本改为 5.9.7 外,没有任何变化。
<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<xhtml-macro name="my-confluence-plugin" class="com.example.api.ExampleMacro" key="my-macro">
<parameters/>
<category name="navigation" />
</xhtml-macro>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="my-confluence-plugin"/>
<!-- add our web resources -->
<web-resource key="my-confluence-plugin-resources" name="my-confluence-plugin Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="my-confluence-plugin.css" location="/css/my-confluence-plugin.css"/>
<resource type="download" name="my-confluence-plugin.js" location="/js/my-confluence-plugin.js"/>
<resource type="download" name="images/" location="/images"/>
<context>my-confluence-plugin</context>
</web-resource>
</atlassian-plugin>
我在清理 运行 后在 atlas-运行 控制台中发现了一些错误消息,我认为这可能会提供一些信息:
[INFO] [talledLocalContainer] 2016-03-31 14:00:29,799 WARN [UpmScheduler:thread-2] [atlassian.upm.pac.PacClientImpl] fetchMpacAppInfo Error when querying application info from MPAC: com.atlassian.marketplace.client.MpacException: java.net.UnknownHostException: marketplace.atlassian.com
[INFO] [talledLocalContainer] 2016-03-31 14:00:32,829 ERROR [AtlassianEvent::CustomizableThreadFactory-1] [atlassian.plugin.module.PrefixDelegatingModuleFactory] createModule Detected an error instantiating the module via Spring. This usually means that you haven't created a <component-import> for the interface you're trying to use. https://developer.atlassian.com/x/TAEr for more details.
[INFO] [talledLocalContainer] 2016-03-31 14:00:32,830 WARN [AtlassianEvent::CustomizableThreadFactory-1] [impl.macro.metadata.AllMacroMetadataCache] lambda$loadMacroMetadata Failed to make metadata for module 'com.example.my-confluence-plugin:my-macro': Error creating bean with name 'com.example.api.ExampleMacro': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.confluence.xhtml.api.XhtmlContent]: : No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
[INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.api.ExampleMacro': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.confluence.xhtml.api.XhtmlContent]: : No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
为什么抱怨没有找到符合条件的 XhtmlContent 类型的 bean?
我正在使用 Atlassian SDK v6.2.4。
刚刚发现问题。似乎这是很多人遇到的常见问题。对于同样使用最新 SDK 并遵循 Confluence 当前教程的人,请在此处的 Atlassian 论坛中查看我的回答:https://answers.atlassian.com/questions/38064029/answers/38064450
我正在关注官方 tutorial 关于为 confluence 5.9.7 版编写自定义宏的内容。我从教程中唯一改变的是插件名称和包名称,您可以在我附加的文件中看到它们。 运行ning altas-run.bat后,在Confluence的系统配置页面可以看到插件已经成功安装并启用,两个模块都有。但是当我试图在页面中插入这个宏时,我在宏浏览器中找不到它。
然后我在完全相同的步骤中按照另一个教程 writing a plugin with JSON 进行操作,一切都和上一个一样正常,但仍然无法在宏浏览器中找到宏。我在这个问题上花了好几个小时,真的受够了。
ExampleMacro.java
在包 com.example.api
下。与教程中编写的代码相同。下面是插件描述文件。 pom 由 运行ning atlas-create-confluence-plugin.bat 自动生成。除了 confluence 版本改为 5.9.7 外,没有任何变化。
<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<xhtml-macro name="my-confluence-plugin" class="com.example.api.ExampleMacro" key="my-macro">
<parameters/>
<category name="navigation" />
</xhtml-macro>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="my-confluence-plugin"/>
<!-- add our web resources -->
<web-resource key="my-confluence-plugin-resources" name="my-confluence-plugin Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="my-confluence-plugin.css" location="/css/my-confluence-plugin.css"/>
<resource type="download" name="my-confluence-plugin.js" location="/js/my-confluence-plugin.js"/>
<resource type="download" name="images/" location="/images"/>
<context>my-confluence-plugin</context>
</web-resource>
</atlassian-plugin>
我在清理 运行 后在 atlas-运行 控制台中发现了一些错误消息,我认为这可能会提供一些信息:
[INFO] [talledLocalContainer] 2016-03-31 14:00:29,799 WARN [UpmScheduler:thread-2] [atlassian.upm.pac.PacClientImpl] fetchMpacAppInfo Error when querying application info from MPAC: com.atlassian.marketplace.client.MpacException: java.net.UnknownHostException: marketplace.atlassian.com
[INFO] [talledLocalContainer] 2016-03-31 14:00:32,829 ERROR [AtlassianEvent::CustomizableThreadFactory-1] [atlassian.plugin.module.PrefixDelegatingModuleFactory] createModule Detected an error instantiating the module via Spring. This usually means that you haven't created a <component-import> for the interface you're trying to use. https://developer.atlassian.com/x/TAEr for more details.
[INFO] [talledLocalContainer] 2016-03-31 14:00:32,830 WARN [AtlassianEvent::CustomizableThreadFactory-1] [impl.macro.metadata.AllMacroMetadataCache] lambda$loadMacroMetadata Failed to make metadata for module 'com.example.my-confluence-plugin:my-macro': Error creating bean with name 'com.example.api.ExampleMacro': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.confluence.xhtml.api.XhtmlContent]: : No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
[INFO] [talledLocalContainer] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.api.ExampleMacro': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.confluence.xhtml.api.XhtmlContent]: : No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.confluence.xhtml.api.XhtmlContent] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
为什么抱怨没有找到符合条件的 XhtmlContent 类型的 bean?
我正在使用 Atlassian SDK v6.2.4。
刚刚发现问题。似乎这是很多人遇到的常见问题。对于同样使用最新 SDK 并遵循 Confluence 当前教程的人,请在此处的 Atlassian 论坛中查看我的回答:https://answers.atlassian.com/questions/38064029/answers/38064450