当前位置: 首页 > 知识库问答 >
问题:

汇流自定义宏不显示在宏浏览器中

赵河
2023-03-14

我正在遵循关于为confluence Version5.9.7编写自定义宏的官方教程。我从教程中唯一改变的是插件名和包名,你可以在我附在这里的文件中看到。在运行altas-run.bat之后,我可以在system configuration页面中发现,插件已经成功安装并启用,同时具有两个模块。但是当我试图将此宏插入页面时,我在宏浏览器中找不到它。

<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>
[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$1 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?

共有1个答案

傅越
2023-03-14

我使用的是Atlassian SDK V6.2.4。

刚弄清楚问题。似乎这是一个常见的问题,许多人都会遇到。如果您也在使用最新的SDK,并遵循Confluence的当前教程,请参阅我在Atlassian论坛中的回答:https://answers.Atlassian.com/questions/38064029/answers/38064450

 类似资料:
  • 如何创建具有生成内联输出的主体的汇流宏?以下宏:

  • 这可能吗?我所做的更改需要在服务器上被识别,以便更改不仅仅发生在我的计算机上。此外,我甚至不知道是否可以在不下载外部插件的情况下查看实际的源代码(由于某些原因,外部插件无法工作)。有人做过这样的事吗?

  • 代码中的模式通常预示着需要新的抽象。这一规则对于宏代码本身也一样适用。如果几个宏的定义在形式上比较相似,我们就可能写一个编写宏的宏来产生它们。本章展示三个宏定义宏的例子:一个用来定义缩略语,另一个用来定义访问宏,第三个则用来定义在 14.1 节中介绍的那种指代宏。 16.1 缩略语 宏最简单的用法就是作为缩略语。一些 Common Lisp 操作符的名字相当之长。它们中最典型的 (尽管不是最长的)

  • 2. 宏定义 较大的项目都会用大量的宏定义来组织代码,你可以看看/usr/include下面的头文件中用了多少个宏定义。看起来宏展开就是做个替换而已,其实里面有比较复杂的规则,C语言有很多复杂但不常用的语法规则本书并不涉及,但有关宏展开的语法规则本节却力图做全面讲解,因为它很重要也很常用。 2.1. 函数式宏定义 以前我们用过的#define N 20或#define STR "hello, wo

  • 9.6.8 系统定义的宏 MASM6.11系统定义了大量的标准宏,程序员能很方便地使用它们。在使用这些系统宏之前,要象C语言那样用伪指令INCLUDE把有关“宏库”文件包含在用户的源程序中。主要的系统宏库文件有:DOS.INC和BIOS.INC,它们存放在系统的include子目录中。 例9.18:使用系统宏定义,编写从键盘上读取一个字符。 解: include dos.inc ;把系统宏定义文件