2016-03-31 27 views
2

Ich verfolge die offizielle tutorial über das Schreiben eines benutzerdefinierten Makro für die Confluence-Version 5.9.7. Das einzige, was ich aus dem Tutorial geändert habe, ist der Name des Plugins und der Paketname, den Sie in der Datei sehen können, die ich hier angehängt habe. Nach dem Ausführen von altas-run.bat kann ich auf der Systemkonfigurationsseite in Confluence feststellen, dass das Plugin erfolgreich installiert und aktiviert wurde, mit den beiden Modulen. Aber als ich versuchte, dieses Makro in eine Seite einzufügen, konnte ich es nicht im Makro-Browser finden.Confluence benutzerdefinierte Makro nicht in Makro-Browser

Ich folgte dann einem anderen Tutorial writing a plugin with JSON in genau dem gleichen Schritt, alles geht gut wie der vorherige, aber immer noch nicht finden Sie das Makro im Makro-Browser. Ich habe Stunden mit diesem Thema verbracht und bin wirklich satt geworden.

Die ExampleMacro.java ist unter der Packung com.example.api. Derselbe Code wie im Tutorial geschrieben. Unten ist die Plugin-Beschreibungsdatei. Der Pom wird automatisch generiert, indem atlas-create-confluence-plugin.bat ausgeführt wird. Nichts änderte sich bis auf die Confluence-Version zu 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> 

Ich fand einige Fehlermeldung in der Atlas-run-Konsole nach einem sauberen Lauf, ich denke, einige Informationen liefern kann:

[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: {} 

Warum tut es beklagt, dass keine qualifizierende Bohne vom Typ XhtmlContent gefunden ?

Antwort

1

Ich verwende Atlassian SDK v6.2.4.

Nur herausgefunden, das Problem. Scheint so, als ob dies ein häufiges Problem ist, das viele Leute getroffen haben. Für diejenigen, die auch das neueste SDK verwenden und dem aktuellen Tutorial von Confluence folgen, sehe bitte meine Antwort im Forum von Atlassian hier: https://answers.atlassian.com/questions/38064029/answers/38064450