내 가젯의 경우 atlassian-plugin.xml
에서 모든 XML, HTML, JavaScript 및 CSS를 분리합니다.
처음에는 설정이 더 복잡하지만 일단이 문제가 해결되면 atlassian-plugin.xml
파일에 모든 항목을 변경하는 것보다 훨씬 편리합니다.
상대 경로는 실제로 미친 것처럼 보입니다.
내 파일 시스템은 다음과 같습니다
- resources/
- gadgets/
- css/
- example.css
- html/
- example.html
- js/
- example.js
- examaple-gadget.xml
- atlassian-plugin.xml
/resources/atlassian-plugin.xml
에서 :
<!-- add our web resources -->
<web-resource key="${project.artifactId}-resources" name="${project.artifactId} Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="example-gadgets/" location="/gadgets"/>
<context>immersive-for-connections</context>
</web-resource>
<gadget name="Example JIRA Gadget" i18n-name-key="example-jira-gadget.name" key="example-jira-gadget" location="gadgets/example-gadget.xml">
<!-- hosted at: /rest/gadgets/1.0/g/${project.groupId}.${project.artifactId}:example-gadgets/gadgets/example-gadget.xml -->
<description key="jira-query-gadget.description">The JIRA Query Gadget Plugin</description>
</gadget>
/resources/gadgets/example-gadget.xml
에서 (정확한 값으로 $ {project.artifactId}
& ${project.groupId}
교체) :
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
...
<Content type="html" view="example.view" preferred_width="100%" href="../../../../../../download/resources/${project.groupId}.${project.artifactId}:${project.artifactId}-resources/gadgets/html/example.html"/>
</Module>
/resources/gadgets/html/example.html
에서 (정확한 값으로 $ {project.artifactId}
& ${project.groupId}
교체) :
<!DOCTYPE html>
<html>
<head>
...
<!-- added ../../../../../../download/resources/${project.groupId}.${project.artifactId}:${project.artifactId}-resources/gadgets/ to most relative links -->
<link href="../../../../../../download/resources/${project.groupId}.${project.artifactId}:${project.artifactId}-resources/gadgets/css/example.css" type="text/css" rel="stylesheet">
<script src="../../../../../../download/resources/${project.groupId}.${project.artifactId}:${project.artifactId}-resources/gadgets/js/example.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
...
</body>
</html>
JIRA의 개발자 문서는 무엇을 말하는가? – Andy
대단히 ...하지만 이해할 수있는 것은 아무것도 없습니다. (https://developer.atlassian.com/display/JIRADEV/Web+Resource+Plugin+Module 등) –
이 https : //도 발견했습니다. answers.atlassian.com/questions/38299/jira-css-font-family-font-color-in-activity-stream-and-dashboard-gadgets하지만 첫 번째 답변을 이해하지 못하고 두 번째 복용량이 작동하지 않습니다 (?). . –