diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..100aaf7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,6 @@ +To avoid future confusion, we recommend that you include a license with your plugin. +This file is simply a reminder. + +For a template license you can have a look at: http://www.opensource.org/licenses/ + +Atlassian releases most of its modules under a BSD license: http://www.opensource.org/licenses/bsd-license.php diff --git a/README b/README new file mode 100644 index 0000000..18e5678 --- /dev/null +++ b/README @@ -0,0 +1,13 @@ +You have successfully created a plugin using the JIRA plugin archetype! + +Here are the SDK commands you'll use immediately: + +* atlas-run -- installs this plugin into JIRA and starts it on http://localhost:2990/jira +* atlas-debug -- same as atlas-run, but allows a debugger to attach at port 5005 +* atlas-cli -- after atlas-run or atlas-debug, opens a Maven command line window: + - 'pi' reinstalls the plugin into the running JIRA instance +* atlas-help -- prints description for all commands in the SDK + +Full documentation is always available at: + +https://developer.atlassian.com/display/DOCS/Developing+with+the+Atlassian+Plugin+SDK diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..84ac506 --- /dev/null +++ b/pom.xml @@ -0,0 +1,83 @@ + + + + 4.0.0 + org.freedomsponsors.plugins + jira + 1.0-SNAPSHOT + + FreedomSponsors + http://www.freedomsponsors.org/ + + FreedomSponsors Jira + This is the Jira plugin for Atlassian JIRA. + atlassian-plugin + + + com.atlassian.jira + jira-api + ${jira.version} + provided + + + + + + junit + junit + 4.8.1 + test + + + com.atlassian.jira + jira-tests + ${jira.version} + test + + + com.atlassian.jira + jira-func-tests + ${jira.version} + test + + + org.mockito + mockito-all + 1.8.5 + test + + + + + + com.atlassian.maven.plugins + maven-jira-plugin + ${amps.version} + true + + ${jira.version} + ${jira.version} + + + + + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + 5.0 + 3.9.3 + + diff --git a/src/main/java/org/freedomsponsors/plugins/jira/SponsorThis.java b/src/main/java/org/freedomsponsors/plugins/jira/SponsorThis.java new file mode 100644 index 0000000..e2d3a36 --- /dev/null +++ b/src/main/java/org/freedomsponsors/plugins/jira/SponsorThis.java @@ -0,0 +1,33 @@ +package org.freedomsponsors.plugins.jira; + +import com.atlassian.crowd.embedded.api.User; +import com.atlassian.jira.config.properties.APKeys.JiraIndexConfiguration; +import com.atlassian.jira.functest.config.JiraConfig; +import com.atlassian.jira.issue.Issue; +import com.atlassian.jira.plugin.webfragment.contextproviders.AbstractJiraContextProvider; +import com.atlassian.jira.plugin.webfragment.model.JiraHelper; +import com.atlassian.jira.util.http.JiraUrl; + + +import java.sql.Timestamp; +import java.util.HashMap; +import java.util.Map; + +public class SponsorThis extends AbstractJiraContextProvider +{ + + @Override + public Map getContextMap(User user, JiraHelper jiraHelper) { + Map contextMap = new HashMap(); + //String baseUrl = (String)jiraHelper.getContextParams().get("baseurl"); + Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue"); + String issueKey = currentIssue.getKey(); + contextMap.put("issueKey", issueKey); + //contextMap.put("baseUrl", baseUrl); + + + return contextMap; + } + + +} diff --git a/src/main/resources/atlassian-plugin.xml b/src/main/resources/atlassian-plugin.xml new file mode 100644 index 0000000..6a9c450 --- /dev/null +++ b/src/main/resources/atlassian-plugin.xml @@ -0,0 +1,21 @@ + + + + + ${project.description} + ${project.version} + + + + + Sponsors the issue at FreedomSponsors.org + http://www.freedomsponsors.org/core/issue/sponsor?trackerURL=${baseurl}/browse/${issue.key} + + + + + diff --git a/src/main/resources/org/freedomsponsors/plugins/jira.properties b/src/main/resources/org/freedomsponsors/plugins/jira.properties new file mode 100644 index 0000000..ec187cd --- /dev/null +++ b/src/main/resources/org/freedomsponsors/plugins/jira.properties @@ -0,0 +1,4 @@ + +sponsor-this.name=SponsorThis +sponsor-this.description=The SponsorThis Plugin +sponsor-this.title=Sponsor This! diff --git a/src/main/resources/sponsorthis.vm b/src/main/resources/sponsorthis.vm new file mode 100644 index 0000000..a3e24ee --- /dev/null +++ b/src/main/resources/sponsorthis.vm @@ -0,0 +1,3 @@ +

+ Sponsor $issue.key on FreedomSponsors.org $issue.project.url +

\ No newline at end of file diff --git a/src/test/java/it/MyPluginTest.java b/src/test/java/it/MyPluginTest.java new file mode 100644 index 0000000..6390da9 --- /dev/null +++ b/src/test/java/it/MyPluginTest.java @@ -0,0 +1,11 @@ +package it; + +import org.junit.Test; + +public class MyPluginTest +{ + @Test + public void integrationTest() + { + } +} diff --git a/src/test/java/org/freedomsponsors/plugins/jira/SponsorThisTest.java b/src/test/java/org/freedomsponsors/plugins/jira/SponsorThisTest.java new file mode 100644 index 0000000..2883e8e --- /dev/null +++ b/src/test/java/org/freedomsponsors/plugins/jira/SponsorThisTest.java @@ -0,0 +1,11 @@ +package org.freedomsponsors.plugins.jira; + +import org.junit.Test; + +public class SponsorThisTest +{ + @Test + public void testSomething() + { + } +} diff --git a/src/test/resources/TEST_RESOURCES_README b/src/test/resources/TEST_RESOURCES_README new file mode 100644 index 0000000..18ac9db --- /dev/null +++ b/src/test/resources/TEST_RESOURCES_README @@ -0,0 +1,3 @@ +Create any of the test resources you might need in this directory. + +Please remove this file before releasing your plugin. diff --git a/src/test/xml/TEST_XML_RESOURCES_README b/src/test/xml/TEST_XML_RESOURCES_README new file mode 100644 index 0000000..a79790f --- /dev/null +++ b/src/test/xml/TEST_XML_RESOURCES_README @@ -0,0 +1,3 @@ +Create all XML test resources here - these might be needed for populating JIRA instance at the integration-test phase with test data. + +Please remove this file before releasing your plugin.