This server will be upgraded to the latest 2.9 milestone around 6am Sydney time Monday the 28th of July and will experience downtime.
Added by Jonathan Nolen, last edited by Chris Broadfoot on Jun 28, 2008  (view change) show comment

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Overview

This documentation contains all of the information you'll need to start building your own plugins and extensions for Atlassian's products. We set several goals for our plugin development process:

  • Allow you to set up a complete plugin development environment with just a few commands.
  • Ensure that all plugins are set up, built, tested and released in a consistent way.
  • To allow you to use the IDE you prefer.
  • To make the code/deploy/test cycle as efficient as possible.
  • To encourage unit and functional testing
  • To use continuous integration and code coverage metrics to ensure plugins are of high quality, and that they stay compatible with new releases of the products.
  • Make it easy to release your plugins to the community.
  • To encourage collaboration around plugin development.

Quickstart for the impatient

Requirements

Java: Many of Atlassian customers are still using Java 1.4, either by choice or because their app servers still require it. If you are building a plugin exclusively for internal use, you're free to target whichever JDK you wish. However, if you are planning to share your plugin with other Atlassian users, you must check what requirements your targetted product has, and unless stated explicitly we recommend you make sure that it is compatible with Java 1.4.

Maven 2: The Atlassian plugin development process depends heavily on Maven. Calling Maven a "build tool" would be an understatement - but if you have no experience with Maven yet, start thinking of it as a tool for simplifying your life by building your plugin. Quoting its homepage, "Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information."

Maven is particularly useful in this instance because it can automatically manage massive dependency trees - especially transitive dependencies where Plugin X depends on Product Y, which depends on Shared Library Z. Using Maven, you should be able to quickly and easily retrieve all the dependencies that your plugin will need, and create a working development environment in just a few steps.

Atlassian Maven PDK: We've written a maven extension specifically for plugin developers. The extension provides a new packaging type for atlassian-plugins, gives you some utility methods for uploading, enabling, disabling and uninstalling a plugin to the product, and provides methods for integration and functional testing.

Settings.xml

In order for Maven to find and download all of the necessary dependencies, we have to tell it where everything is stored. The best option is to do that once, in your $HOME/.m2/settings.xml file. We've included an Example settings.xml

  • Place the Example settings.xml in your $HOME/.m2 directory.
  • If you look closely, you will find two lines containing placeholders for username&password. Don't worry about them at this moment - you don't need them to get started.

Your plugin will depend on many different artifacts: the Atlassian product itself, Atlassian modules and various open-source libraries. All of those artifacts are stored in different maven repositories scattered around the net. However, to simplify configuration and speed downloads, Atlassian provides a Maven proxy that contains all of the dependencies for all of our products. The example settings file contains just one repository entry for this proxy, and saves Maven from having to check several different repositories for each artifact it needs. You can find more information about the repositories that are behind the Maven Proxy.

Atlassian will release binary and javadoc artifacts for all of our product releases and their Atlassian-managed dependencies. We will release source artifacts wherever we can freely do so. Some of our closed-source artifacts will only be available via manual download by source-license-holders.

We will also be releasing various milestone and snapshot releases during product development to aid plugin developers in testing their work against upcoming product releases.

You will be able to find all of these artifacts in the Maven proxy.

Creating a skeleton plugin

Now you're ready to create your (skeleton) plugin. This involves creating plenty of directories and subdirectories, two XML files and initial Java files. Fortunately, Maven can help here, too, and simplify your life a lot! Maven has a concept called an Archetype, which is basically a plugin template. We've created plugin templates for each of our pluggable products, so you can use those templates to set up your initial plugin skeleton easily. You can find the Atlassian Plugin Archetypes and how you use them here. Visit the page, create a plugin for your targetted Atlassian product, and return to this page later.

Running an plugin archetype will download dependencies from the internet, set up a project skeleton, and prepare you to run unit and functional tests. Once you run the Maven archetype command, you'll find that it creates a new directory structure that looks like this:


Here a a few points to note:

It's important to understand a little bit about the pom.xml, and what's in it. The Project Object Model describes everything that maven needs to know about your plugin, from dependencies, to source control, to authors, to tests, to deployment locations. The POM is also hierarchical, so many properties are inherited. You'll note that this pom.xml inherits from something like atlassian-confluence-base, which contains lots of information about the products and the Atlassian development environment. Some properties are later overridden in your plugin's POM.

We've written a page with an Example pom.xml that explains what's going on in your plugin's POM.

Please note: The plugin now knows about the target product's binaries, because it has downloaded the JAR files - but it has not downloaded the actual source code. You don't need to have access to the target product's sourcecode to be able to develop a plugin, the JAR files alone will enable you to go and write the plugin, using the product's API. If you do have access to the source code (e.g. as a commercial license holder) then it helps to download and set up the source code now:

Special section for commercial license holders with Confluence source access.

Since you have purchased a commercial license to Confluence, you have access to all of the Confluence source code. You can download a source distribution by visiting http://my.atlassian.com. You can attach the Confluence source code to your plugin project so that you can step through the Confluence code in your debugger. It's often helpful to do this to better understand that API, or to track down problems.

Once you've downloaded and unpacked the source distribution, you'll see a bunch of directories and files, exactly as they are checked out of our SVN repository. This is perfect for reading and exploring, but it doesn't do you much good in the brave new world of Maven 2. So what you'll need to do is create and install source artifacts into your local maven repository. Once you've done that, the maven IDE plugins will recognize that they are there and link them up for debugging purposes.

From the top level of the source distribution, run:

mvn source:jar install -Dmaven.test.skip=true

This will build and install most of our source-code. There are still a few items that aren't yet set up for this, but the important ones are, like the core product source code. Likewise, we will soon be enabling this same process for JIRA.

A note about memory: This is a resource intensive process, and you may need to allocate more memory to maven in order to complete it. You can do so be setting an environment variable called MAVEN_OPTS, like so export MAVEN_OPTS=-Xmx512m

A note about versions: Make sure that you download and install the same version of the source code that is set in the confluence.version property in your pom.xml.

Maven and your IDE

We have our plugin skeleton, and now it's time to get it set up in your IDE. Once again, Maven comes to the rescue. Maven has plugins to generate project files for both Eclipse and IntelliJ IDEA. Our instructions will cover these two IDEs, but you're free to use whichever IDE you prefer.

To set up your IDE project, simply run mvn eclipse:eclipse or mvn idea:idea from the root folder of the newly created directory (e.g. where the pom.xml resides).

First, Maven will download all of the dependencies referenced in your pom.xml, and then all the inherited dependencies from the parent POMs. Your settings.xml specifies that maven should down the javadoc and source files as well, where they are available. This is likely to take quite a while: Depending on what product you are targetting, Maven will now download hundred MB or more from the internet. Go relax, get some coffee, read a blog. Fortunately, after you've downloaded these files for the first time, they are stored in your local Maven repository ($HOME/.m2/repository/) and won't be downloaded again unless they change.

In case this process ended with an error message (e.g. "required artifact missing") please refer to FAQ and Troubleshooting

Second, Maven will construct project files that your IDE can understand. It will reference all the dependent jars in the right projects, and attach the sources and javadoc where they are available. Note, when you're ready to check in your plugin, don't commit these project files as they are generally specific to each developer's machine.

Open the project files in your IDE, and you should see the mostly-empty template directory for your new plugin, matching the directory structure in the screenshot above.

Using a different build tool

These instructions depend on using Maven. However, if you want to use your own build environment (e.g. Ant), the following Maven command will export all the JAR files you need to develop against to the directory you specify, and you can then ensure that these JAR files are in your CLASSPATH using your build tool.

mvn dependency:copy-dependencies -DoutputDirectory=<specify a directory>

Developing your plugin

So now what? Find out how the development/test/debug cycle works. We've tried to make it as efficient as possible.

Testing your plugin

Atlassian plugins depend on Maven 2 for running their test suites. This is advantageous because all plugins are always tested the same way, and because Bamboo, our continuous integration server, can do likewise.

Building a suite of tests for your plugin is extremely important. We're big believers in Test Driven Development, and we think that writing tests as you go is one of the best ways to ensure you build a high-quality and functional application. Additionally, having a comprehensive suite of tests means that other developers in the community (or even Atlassian developers) can jump in and collaborate on your plugin without fear of breaking anything inadvertently.

Find out how to make it happen on the Testing your plugin page.

A note about quality

We have set certain criteria for our own plugin development. If you are working on a plugin that you wish to share with the community, we encourage you to try and meet these same criteria in your work. It will result in a higher quality product and make it easier for other to collaborate.

Your plugin should:

Atlassian offers hosting for plugins to all authors. Find out more about the resources and how to take advantage of them here.

Releasing your plugin

Atlassian offers lots of services to help you host your plugin development project. We can provide an SVN repository with Fisheye and Crucible, a JIRA project, Confluence space, a Bamboo Project, a Maven repository for artifacts, and more. When you're ready to start collaborating with other developers on your plugin project, read about Releasing your plugin. Contact us and we'll grant you account and get everything set up for you.

Resources

Where do you go for help? For questions about plugin development for Atlassian products, head to the Developer Forum. These are community run forums where other plugin developers ask and answer questions, get advice, and publicize their latest work.

NOTE: Please do not file support tickets at http://support.atlassian.com regarding plugin development questions. The engineers on support are not equipped to answer those sorts of questions.

Looks like the plugin development documentation was revamped.  Previously, you had to get the source distribution and compile it.  It seems that it's no longer necessary.  I'm trying to follow along the new documentation and have some comments:

1.  I think the documentation should have an explanation why you might want to get/build the confluence source. I'm guessing that the only reason is to be able to step into Confluence code in order to better understand how it works so that you can write your plugin effectively.

2. The page has a sample settings.xml.  I replaced my existing settings.xml and tried to  follow the steps in: http://confluence.atlassian.com/display/DEVNET/Atlassian+Plugin+Archetypes but I get a build error:

[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found

3. It would be helpful to have some info for people who want to take an existing plugin and enhance it or implement some bug fixes.

I get the following error trying to run mvn eclipse:eclipse command :



[INFO] Scanning for projects...
Downloading: https://maven.atlassian.com/repository/public/com/atlassian/jira/plugins/jira-plugin-base/5/jira-plugin-base-5.pom
Downloading: https://maven.atlassian.com/maven1/com.atlassian.jira.plugins/poms/jira-plugin-base-5.pom
Downloading: http://repo1.maven.org/maven2/com/atlassian/jira/plugins/jira-plugin-base/5/jira-plugin-base-5.pom
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: MyProject:MyPlugin:jar:1.0-SNAPSHOT

Reason: Cannot find parent: com.atlassian.jira.plugins:jira-plugin-base for project: MyProject:MyPlugin:jar:1.0-SNAPSHOT for project MyProject:MyPlugin:jar:1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.atlassian.jira.plugins:jira-plugin-base for project: MyProject:MyPlugin:jar:1.0-SNAPSHOT for project MyProject:MyPlugin:jar:1.0-SNAPSHOT
 at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:376)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:289)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: com.atlassian.jira.plugins:jira-plugin-base for project: MyProject:MyPlugin:jar:1.0-SNAPSHOT for project MyProject:MyPlugin:jar:1.0-SNAPSHOT
 at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1259)
 at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:745)
 at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:476)
 at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:197)
 at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:548)
 at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:458)
 at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:362)
 ... 11 more



Any ideas on what might be the issue ? I have copies the settings.xml file under $HOME/.m2 diretory. Thanks in advance for your reply.

Posted by ananth at Jan 23, 2008 13:50

by the looks of it, when maven was trying to download jira-plugin-base-5.pom, it failed for whatever reason and tried to download it from the alternate repositories (which don't exist, so they'd have to fail).

a likely cause of this is that you've set up your proxy settings in maven incorrectly and so it can't access the repository. when i was having this issue, it would try to download a file for at least 10 seconds before deciding that it couldn't get it.

you can learn how to set up proxies for maven here: http://maven.apache.org/guides/mini/guide-proxies.html
note that you'll have to set up proxy setting entries for both http and https, though they'll most likely be exactly the same other than the protocol and name

Thank you very much. I was indeed missing the proxy settings for https. I cant however seem to be able to specify both http and https proxy configurations at the same time. I could only get this to work if I substituted the http proxy section with https.

Posted by ananth at Jan 26, 2008 13:24

i think it may be necessary to specify ids for each of the proxies, which is done with with the <ID> tag.

here's how it looks in mine, which seems to work, though i don't think it's accessed any http servers recently

 <proxies>
    <proxy>
      <id>httpsproxy</id>
      <active>true</active>
      <protocol>https</protocol>
      <username></username>
      <password></password>
      <host>hostip</host>
      <port>hostport</port>
      <nonProxyHosts>localhost</nonProxyHosts>
    </proxy>
    <proxy>
      <id>httpproxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <username></username>
      <password></password>
      <host>hostip</host>
      <port>hostport</port>
      <nonProxyHosts>localhost</nonProxyHosts>
    </proxy>
    </proxies>

Any suggestions on what one should do when trying to modify an existing plugin that was built in Ant (therefore there is only a build.xml, not a project.xml or pom.xml)? Given the rather extensive modifications I am attempting, I would like to be able to do my work in a real IDE like Eclipse, and build and test it according to these instructions. As it is though I am unsure how to go about this

Well, this page is only partly applicable, but you can start here: How to convert an existing plugin to the new development framework.

The main task will be to create a valid POM for your project. I might advise using the archetype to create an empty project, and the copy your old files into the new structure.

Thanks for the Tip! I was just wondering about that...

Couple of comments:

Current confluence source build instructions fail with

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.maven.plugins
ArtifactId: maven-clover-plugin
Version: 2.4.1

Reason: Unable to download the artifact from any repository

  org.apache.maven.plugins:maven-clover-plugin:pom:2.4.1

My hack wordaround: added ibiblio as a central mirror in settings.xml and hacked my local copy of atlassian-base-pom-8.pom to make Maven fetch 2.4 instead.

Looks like the latest version of maven doesn't work with the plexus-compiler. At least there's a fix for it in the plexus fisheye but nothing past 1.5.3 yet.

The error is:

[INFO] [compiler:compile]
[INFO] Compiling 1 source file to /Users/mdoar/jira/timecharts/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Fatal error compiling

Embedded error: Prohibited package name: java.lang
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Fatal error compiling
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
	at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:498)
	at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)

Forcing my mac to use jdk1.4 got me past that problem.

I modified and compiled the jira3 plugin since some time, i did that when ant was runable without modifications in the confluence/plugins folder. Now i am switching to the maven2 style and the only way to get this to run was to write the follwing into my settings.xml:

<mirrors>
     <mirror>
       <mirrorOf>central</mirrorOf>
       <name>atlassian-central</name>
       <url>https://maven.atlassian.com/contrib</url>
       <id/>
     </mirror>
     <mirror>
            <mirrorOf>central</mirrorOf>
            <name>another-atlassian-central</name>
            <url>https://maven.atlassian.com/repository/public</url>
            <id/>
     </mirror>
  </mirrors>

I tried all of the steps listed here, but all other except central is ignored. So if anyone can tell me how to run the "official" way or whether its not good this way i would be thankfull.

Are the example files included in the previous development kit included in this build environment?  I trying to build a plugin using Maven 2.0 and Eclipse, but I haven't had too much success.  Some kind of example would be very helpful.

Hi everyone,

 I installed both maven and the PDK successfully, now I am trying to get a JIRA archetype up and running.  I keep getting this error:

 C:\Documents and Settings\Chris\.m2>mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using  VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable
 to find resource 'VM_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: null
[INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from atlassian-public
[WARNING] repository metadata for: 'artifact org.apache.maven.archetypes:maven-archetype-quickstart' could not be retrieved from repository:
 atlassian-public due to an error: Error transferring file
[INFO] Repository 'atlassian-public' will be blacklisted
[INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from atlassian-contrib
[WARNING] repository metadata for: 'artifact org.apache.maven.archetypes:maven-archetype-quickstart' could not be retrieved from repository:
 atlassian-contrib due to an error: Error transferring file
[INFO] Repository 'atlassian-contrib' will be blacklisted
[INFO] artifact org.apache.maven.archetypes:maven-archetype-quickstart: checking for updates from atlassian-m1-repository
[WARNING] repository metadata for: 'artifact org.apache.maven.archetypes:maven-archetype-quickstart' could not be retrieved from repository:
 atlassian-m1-repository due to an error: Error transferring file
[INFO] Repository 'atlassian-m1-repository' will be blacklisted
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating Archetype: maven-archetype-quickstart:RELEASE
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: null
[INFO] Parameter: packageName, Value: null
[INFO] Parameter: basedir, Value: C:\Documents and Settings\Chris\.m2
[INFO] Parameter: package, Value: null
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: null
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating from archetype

Embedded error: Artifact ID must be specified when creating a new project from an archetype.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 6 seconds
[INFO] Finished at: Fri May 30 16:52:58 PDT 2008
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------

C:\Documents and Settings\Chris\.m2>  -DarchetypeGroupId=com.atlassian.maven.archetypes
'-DarchetypeGroupId' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Chris\.m2>  -DarchetypeArtifactId=jira-plugin-archetype
'-DarchetypeArtifactId' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Chris\.m2>  -DarchetypeVersion=10
'-DarchetypeVersion' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Chris\.m2>  -DremoteRepositories=https://maven.atlassian.com/repository/public/
'-DremoteRepositories' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Chris\.m2>  -DgroupId=XXX.XXXX.jira.plugin.pilot -DartifactId=pilot

Anyone seen this error before?  Is there any way to fix it? (putting the arguments in " " to prevent the = split in the windows cmd prompt doesn't work ; ) )

Thanks! 

Hi Chris,

On Windows you will have to put all of the arguments on a single line before you hit enter. On Unix and relativies you can break it up by putting '
' at the end of each line, but that won't work in Windows. As such, you'll have to copy-n-paste each line individually onto the end of your command.

Personally, I set up a batch file which just needed me to provide the groupId and artifactId. Much simpler...

Hi,

the archetype creation and other maven tasks work for me, but I'm getting problems with eclipse plugin. The .classpath file is not created at all, and the .project file looks like:

<projectDescription>

  <name>jira-ps-plugin</name>

  <comment>Parent POM for JIRA plugins. Specifies which version of Java to compile
        against, and Maven repositories for JIRA and its dependencies.</comment>

  <projects/>

  <buildSpec/>

 <natures/>

</projectDescription>

Does it work how it should?

Posted by Justy Justinson at Jun 10, 2008 05:39 Updated by Justy Justinson

There is an issue with some versions of the atlassian-pdk plugin that causes the problem you're seeing. This has been fixed in atlassian-pdk, but unfortunately the Maven configuration for tge Confluence plugin archetype is still using an older version. You can force it to use the latest version by putting this into your plugin's pom.xml file:

<build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>atlassian-pdk</artifactId>
                <version>2.1.5-SNAPSHOT</version>
            </plugin>
        </plugins>
    </build>

(If your POM already has a <build> section, just add the <plugins> section inside it)

We plan to release atlassian-pdk-2.1.5 and create a new version of the archetype and the plugin base POM that use it as soon as we can. Sorry about the confusion in the meantime.

Littlle frustrated as this page says "Atlassian provides a Maven proxy that contains all of the dependencies for all of our products." However if you go to the attlassian-mail link, you can't find anything...

https://maven.atlassian.com/browse/atlassian-mail/atlassian-mail/1.5

 Where am I supposed to get this from now?

I already downloaded Eclipse 3.2. I'm using the JDK 1.4. I also downloaded Apache Maven 2.0.9 which I used to download all the libraries included in the Jira-development-kit-3.2 for Eclipse. I stored all the libraries inside the /.m2/ folder. So.. It should work, but it doesn't, because whenever I try to open a new project in Eclipse(it doesn't matter if I chose a Java project or a Plug-in project, the desired template to develop a jira plug-in. And if link the libraries to the project it doesn't reckon the jar files as libraries. What am I doing wrong?

Posted by iconde at Jul 04, 2008 06:35

Are you using 'mvn eclipse:eclipse' to generate the Eclipse project files? You shouldn't need to download any libraries yourself, or manually set up your project classpath. When you want to open the project you should tell Eclipse to import the existing project rather than creating a new one from scratch.

I got the errors below when I tried the steps until this one - Run mvn idea:idea or mvn eclipse:eclipse in the top-level directory of your new plugin.

08-7-7 下午03时59分28秒: Scanned javadoc C:/Documents and Settings/lijian/.m2/repository/com/atlassian/extras/atlassian-extras/1.12/atlassian-extras-1.12-javadoc.jar 0.0
08-7-7 下午03时59分28秒: Scanned javadoc C:/Documents and Settings/lijian/.m2/repository/com/atlassian/renderer/atlassian-renderer/3.14/atlassian-renderer-3.14-javadoc.jar 0.0
08-7-7 下午03时59分29秒: Parsing error C:\Documents and Settings\lijian\.m2\repository\seraph\seraph\0.7.17\seraph-0.7.17.pom; org.codehaus.plexus.util.xml.pull.XmlPullParserException: Unrecognised tag: 'id' (position: START_TAG seen ...<dependency>\r\n      <id>... @51:11)
08-7-7 下午03时59分29秒: Unable to read test/pom.xml; org.eclipse.core.runtime.CoreException: Parsing error C:\Documents and Settings\lijian\.m2\repository\seraph\seraph\0.7.17\seraph-0.7.17.pom; org.codehaus.plexus.util.xml.pull.XmlPullParserException: Unrecognised tag: 'id' (position: START_TAG seen ...<dependency>\r\n      <id>... @51:11)
 

Try deleting C:\Documents and Settings\lijian\.m2\repository\seraph\seraph\0.7.17\seraph-0.7.17.pom and give it another shot. It looks like Maven may have downloaded it incorrectly.

Many thanks for your reply. I've tried deleting seraph folder and delete seraph-0.7.17.pom, but none of them worked. Then I checked the pom file on https://maven.atlassian.com/repository/public, and found that seraph-0.7.17.pom is using modelversion 3, which is inconsistent with modelversion 4.0.0. 

I think a newer version should be used, such as seraph-0.7.19 or 0.7.23 etc. But I don't know which jar is using  seraph-0.7.17

I found where is the problem: I hated to see some many elements in the .classpath file, such as:

 <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/>
 <classpathentry kind="var" path="M2_REPO/mockobjects/alt-jdk1.3/0.07/alt-jdk1.3-0.07.jar"/>...

so I deleted them all, replaced with one line:
  <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>

Then I got  org.codehaus.plexus.util.xml.pull.XmlPullParserException as mentioned before.

I can fix this problem by leaving around 200 elements as< classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.0.2/activation-1.0.2.jar"/> in .classpath file, but I think it's not a good solution.

View the rest of this thread. Most recent comment: 17 days ago
2 more comments by: Tim Moore, Jacky Li

OK.  I'm very new to Jira and have downloaded Maven and the PDK plugin.  Where do I install these?  On the server that has Jira installed, or is this a local application to my desktop?  A lot of this documentation makes it look like it has to be on the server with Jira, but nothing specific addresses this.  If so, then does Jira then suddenly provide some menu option to get into Maven to develope plugins?

Ray,

Maven is a development tool that you want to install on your development workstation. It will let you run a simple JIRA server on your workstation for testing. When your plugin is finished, you can upload the plugin JAR onto your production JIRA server. You don't need Maven on the JIRA server.

The PDK plugin is automatically downloaded by Maven when you build your plugin. You don't need to install it yourself.

If you're having trouble getting started, I'd recommend joining the JIRA Dev forum and asking questions there.

--
Tim Moore
Atlassian Plugin Developer