Create scheduled task plugin ?

Hi ,

 

When i searched regarding the scheduled task in JIRA, i found the below link about scheduled task with sample example . it was perfect example , but still i have some queries on that .

http://www.j-tricks.com/tutorials/scheduled-tasks-in-jira

 

The below is the folder structure created in that sample example package:

scheduled-task-plugin\pom.xml

scheduled-task-plugin\src\main\java\com\jtricks\JTricksScheduledJob.java

 

1,How to build Jar for this above example .

2,what is purpose of having pom.xml.

 

pom.xml:

 

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.jtricks</groupId>
    <artifactId>scheduled-task-plugin</artifactId>
    <version>1.0</version>

    <organization>
        <name>J Tricks</name>
        <url>http://www.j-tricks.com/</url>
    </organization>

    <name>scheduled-task-plugin</name>
    <description>This is the Example com.jtricks:scheduled-task-plugin plugin for Atlassian JIRA.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>atlassian-jira</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-func-tests</artifactId>
            <version>${jira.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>3.0.6</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.data.version}</productDataVersion>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <jira.version>4.0.2</jira.version>
        <jira.data.version>4.0</jira.data.version>
    </properties>

</project>

 


 



 

 

1 answer

1 accepted

0 vote

You don't really need a pom for this. You can create the jar from eclipse or simply by packaging the files. In this case, pom was added just to make it easy to build the jar and also to start a JIRA instance for testing wink

Btw, you might also want to look at this tutorial. Involves a little bit more work up front but then you don't have to modify the scheduler-config.

Hello i am using the same tutorial for my scheduler,

http://www.j-tricks.com/1/post/2011/05/scheduled-tasks-in-jira.html

 

Now I need to run it one of it every Midnight, one every Monday and one to every Month end .  how we can set the scheduler interval to 1 week. or one month I want my scheduler to run every Monday or every month end .

please give me some suggestion on how we can set the scheduler interval to 1 week or end of the month .

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

159 views 1 17
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you