OverviewThis 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:
Quickstart for the impatient
Use the following command :mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse as this will force mvn to use version 2.6 of the maven eclipse plugin. The error that you will see if 2.7 is used in your mvn build : [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Request to merge when 'filtering' is not identical. [INFO] Original=resource src/main/resources: output=target/classes, [INFO] include=[atlassian-plugin.xml], exclude=[**/*.java], test=false, [INFO] filtering=true, merging with=resource src/main/resources: [INFO] output=target/classes, include=[], exclude=[atlassian-plugin.xml|**/*.java], [INFO] test=false, filtering=false [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ RequirementsJava: Depending on which Atlassian product (and which version of the product) you are building plugins for, you may need either JDK 5 or JDK 1.4. 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. Read How do I specify a particular version of Java? to learn how to use Java 5 language features or enforce building with a particular version of Java. 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. This plugins is automatically installed when you build an Atlassian plugin. Settings.xmlIn 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 instructions and an example that you can copy and paste at Example settings.xml. 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 pluginNow 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:
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 confluence-plugin-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 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 JAR files containing most of our source-code into the target directory of each subproject. 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. The JAR files can be copied into your local Maven repository to make them available in your IDE when you run mvn idea:idea or mvn eclipse:eclipse. For example, to install the source code for Confluence 2.10 core, copy confluence-project/confluence/target/confluence-2.10-sources.jar to $HOME/.m2/repository/com/atlassian/confluence/confluence/2.10. 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 atlassian.product.version property in your pom.xml. Maven and your IDEWe have our plugin skeleton, and now it's time to get it set up in your IDE, if you use one. 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 or editor 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 toolThese 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 pluginSo now what? Find out how the development/test/debug cycle works. We've tried to make it as efficient as possible. Testing your pluginAtlassian 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 qualityWe 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 pluginAtlassian 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. ResourcesWhere 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. |
Labels
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 2.5 Australia License.

Comments (63)
Dec 28, 2007
Bill Smith says:
Looks like the plugin development documentation was revamped. Previously, ...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.
Jan 23, 2008
ananth says:
I get the following error trying to run mvn eclipse:eclipse command : [INF...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.
Jan 24, 2008
aaron frishling says:
by the looks of it, when maven was trying to download jira-plugin-base-5.pom, it...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
Jan 26, 2008
ananth says:
Thank you very much. I was indeed missing the proxy settings for https. I cant h...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.
Jan 28, 2008
aaron frishling says:
i think it may be necessary to specify ids for each of the proxies, which is don...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>
Jan 25, 2008
Kristyn Oliveti says:
Any suggestions on what one should do when trying to modify an existing plugin t...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
Jan 29, 2008
Jonathan Nolen says:
Well, this page is only partly applicable, but you can start here: How to conver...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.
Jan 25, 2008
Roberto Dominguez says:
Thanks for the Tip! I was just wondering about that... Couple of comments: Yo...Thanks for the Tip! I was just wondering about that...
Couple of comments:
Feb 07, 2008
Joshua Goodall says:
Current confluence source build instructions fail with [ERROR] BUILD ERROR [IN...Current confluence source build instructions fail with
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.
Apr 01, 2008
Matt Doar says:
Looks like the latest version of maven doesn't work with the plexus-compiler. At...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:
Apr 01, 2008
Matt Doar says:
Here is the commit that I'm referring to: http://svn.plexus.codehaus.org/change...Here is the commit that I'm referring to:
http://svn.plexus.codehaus.org/changelog/plexus/plexus-components/trunk/plexus-compiler/plexus-compilers?cs=7198
and the post that lead me there:
http://mail-archives.apache.org/mod_mbox/maven-users/200609.mbox/%3Ceb6548830609080343q2cf03932t5b1b39b1dd73f5ca@mail.gmail.com%3E
Apr 01, 2008
Matt Doar says:
Forcing my mac to use jdk1.4 got me past that problem.Forcing my mac to use jdk1.4 got me past that problem.
May 26, 2008
Frank Stiller says:
I modified and compiled the jira3 plugin since some time, i did that when ant wa...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.
May 27, 2008
Ali Ibrahim says:
Are the example files included in the previous development kit included in this ...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.
May 30, 2008
Chris Fletcher says:
Hi everyone, I installed both maven and the PDK successfully, now I am tr...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!
May 30, 2008
David Peterson [CustomWare] says:
Hi Chris, On Windows you will have to put all of the arguments on a single line...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...
Jun 10, 2008
Justy Justinson says:
Hi, the archetype creation and other maven tasks work for me, but I'm getting p...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:
Does it work how it should?
Jun 12, 2008
Tim Moore says:
There is an issue with some versions of the atlassian-pdk plugin that causes the...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.
Jun 19, 2008
Michael Immell says:
Littlle frustrated as this page says "Atlassian provides a Maven proxy that cont...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?
Jul 04, 2008
iconde says:
I already downloaded Eclipse 3.2. I'm using the JDK 1.4. I also downloaded Apach...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?
Jul 07, 2008
Tim Moore says:
Are you using 'mvn eclipse:eclipse' to generate the Eclipse project files? You ...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.
Jul 07, 2008
Jacky Li says:
I got the errors below when I tried the steps until this one - Run mvn idea:idea...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)
Jul 07, 2008
Tim Moore says:
Try deleting C:\Documents and Settings\lijian\.m2\repository\seraph\seraph\0.7.1...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.
Jul 07, 2008
Jacky Li says:
Many thanks for your reply. I've tried deleting seraph folder and delete seraph-...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
Jul 08, 2008
Jacky Li says:
I found where is the problem: I hated to see some many elements in the .classpat...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.
Jul 08, 2008
Tim Moore says:
It looks like that's a bug in m2eclipse: http://jira.codehaus.org/browse/MNGECL...It looks like that's a bug in m2eclipse:
http://jira.codehaus.org/browse/MNGECLIPSE-257
This could continue to be a problem until either the bug is fixed in m2eclipse or JIRA is fully converted to Maven 2. In the meantime, I think that 'mvn eclipse:eclipse' should work, so if you just let it manage your .classpath file that way, you should be good. You don't need to check the .classpath file into source control, since it can be regenerated automatically by Maven, so I'd recommend leaving it alone.
Jul 08, 2008
Jacky Li says:
I understand now, thanksI understand now, thanks
Jul 17, 2008
Ray La Valley says:
OK. I'm very new to Jira and have downloaded Maven and the PDK plugin...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?
Jul 17, 2008
Tim Moore says:
Ray, Maven is a development tool that you want to install on your development w...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
Jul 31, 2008
joshua Rodman says:
I just had a big fight with maven 2 and the example settings.xml file. I had th...I just had a big fight with maven 2 and the example settings.xml file.
I had the following problems
1 - A lot of attribute values were not properly quoted. Maven 2 did not like this.
2 - A lot of input, img and a few other tags were not closed. Maven 2 did not like this.
3 - Some attribute values (hrefs) had ampersand characters that were not correctly quoted, eg <a href="blah&blah"> instead of <a href="blah&blah">. This one was pretty pernicious because the parser gets confused and complains about an invalid use of an equals sign later because it looks like <a href="blah&blah=blah"> and entities can't have equals in their names.
4 - "Error reading settings.xml: Error reading settings file" this last one has me stumped.
I get the feeling that either my maven or java is different from yours:
jrodman@calufrax:~ >mvn --version
Maven version: 2.0.9
Java version: 1.6.0_07
OS name: "linux" version: "2.6.24-1-amd64" arch: "amd64" Family: "unix"
Or someone isn't testing their edits to the Example settings.xml very well.
Jul 31, 2008
Tim Moore says:
Joshua, Are you sure you've created settings.xml correctly? There shouldn't be...Joshua,
Are you sure you've created settings.xml correctly? There shouldn't be any hrefs, img tags or any other HTML in it. The 'Example settings.xml' link above goes to a wiki page that contains the XML source you want, along with some brief instructions – you'll need to copy and paste the XML part into a file. It sounds like you may have downloaded the link directly.
Aug 19, 2008
Jeff Kirby says:
I've followed the instructions. When I open my plug-in project in Eclipse ...I've followed the instructions. When I open my plug-in project in Eclipse I get nothing but errors because all the paths in my build path start with M2_REPO, like M2_REPO/velocity/1.4/velocity-1.4.jar. Did I skip a step in the setup? Why is M2_REPO not resolved to ~/.m2?
Aug 19, 2008
Jeff Kirby says:
I figured it out. Please add this step to your documentation: I needed to ...I figured it out. Please add this step to your documentation: I needed to go into Eclipse | Window | Preferences | Java | Build Path | Classpath Variables and create a variable called M2_REPO which points to /home/me/.m2/repository.
Aug 19, 2008
Tim Moore says:
Done! There's also a way to do the same thing with a Maven command.Done! There's also a way to do the same thing with a Maven command.
Sep 12, 2008
Ethan McDonald says:
I'm making my way through the "How to Build an Atlassian Plugin" I have plugin s...I'm making my way through the "How to Build an Atlassian Plugin" I have plugin skeleton laid out and when I run "mvn idea:idea" command I get "FATAL ERROR".
Someone must have had this happen but all my searches come up with inconclusive solutions.
The one thing that strikes me as unusual is that the URL listed for where it Downloading from doesn't exist !?
http://repo1.maven.org/maven2/com/atlassian/jira/plugins/jira-plugin-base/8/jira-plugin-base-8.pom
ERROR TEXT:
Sep 12, 2008
Jeff Kirby says:
Hi Ethan, I'm guessing that you don't have Atlassian's suggested settings in yo...Hi Ethan,
I'm guessing that you don't have Atlassian's suggested settings in your HOME/.m2/settings.xml file and so Maven is trying to download Atlassian customizations from the central Maven repository at Apache. The .pom that you need is at maven.atlassian.com and that setting has to exist in your settings.xml file. See http://confluence.atlassian.com/display/DEVNET/Example+settings.xml
Hope that helps,
Jeff
Sep 12, 2008
Ethan McDonald says:
Ok I got turned around and thought $HOME translated to %M2_HOME% in windows. It ...Ok I got turned around and thought $HOME translated to %M2_HOME% in windows.
It all makes sense now it's %home% = "C:\Documents and Settings\username", Duh!
Thanks for the help
Sep 12, 2008
Tim Moore says:
Ethan, I responded to your thread on the forum: http://forums.atlassian.com/thre...Ethan, I responded to your thread on the forum: http://forums.atlassian.com/thread.jspa?messageID=257289298� We can continue the conversation there.
Sep 17, 2008
Daniel Berkich says:
I am working in an environment without internet access. Does this mean tha...I am working in an environment without internet access. Does this mean that my only option for building Jira plugins is by using the JIRA plugin dev kit and then using ANT to build it.
Thanks
Sep 22, 2008
Tim Moore says:
Daniel, I think your best bet is to use a computer that does have internet acce...Daniel,
I think your best bet is to use a computer that does have internet access to build an archetype so Maven populates your $HOME/.m2/repository directory with the dependencies you need. Then copy that directory onto your normal development machine and use mvn -o to run Maven in offline mode.
Oct 01, 2008
Thomas Allen says:
The wording on this page makes it seem like Eclipse or IDEA is required for deve...The wording on this page makes it seem like Eclipse or IDEA is required for developing these plugins. Is that the case? I'm not a Java guy by any means, and I use Vim for all code editing. I ran an "mvn clean test" and Maven downloaded quite a bit into my .m2/repository/ directory, but I want to make sure that I'm not missing anything.
Also, how should I structure a theme plugin? Right now, the path to my .vmd files is /asce_theme/src/main/java/com/asce/confluence/themes/asce (based on a page in the main Confluence wiki, not this dev network).
Oct 01, 2008
Tim Moore says:
You don't need to use Eclipse or IDEA — any text editor is fine, and you c...You don't need to use Eclipse or IDEA — any text editor is fine, and you can do all of your builds on the command line. I just adjusted the wording to try to clarify this. Do you think it makes sense now?
Generally, .vmd files and any other non-java files would go into src/main/resources... instead of src/main/java. The difference is that Maven tries to compile the files in src/main/java, whereas files in src/main/resources are simply copied into the plugin. Within that directory, the com/asce/confluence/themes/asce structure looks good. You can actually use any directory structure you like, as long as it matches what you have in atlassian-plugins.xml, but I think using a java-package-like structure, as you are, is a good idea because it reduces the chances of name conflicts between your Velocity files and ones from other plugins, and it means that any Java classes will end up in the same location as the Velocity files within the JAR.
Oct 02, 2008
Thomas Allen says:
Thanks for the quick response, I appreciate it. What you've changed above adds a...Thanks for the quick response, I appreciate it. What you've changed above adds a little clarity, but I think that this is the part that still gets (or would get) me:
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.
Which leaves me with questions like:
It seemed to me like these dependencies were fetched on my first Maven build, but I have no way of knowing that. You may want to completely separate the two sections: Project setup (editor-agnostic), and IDE/editor instructions.
As far as theme plugins go, do I need to include every Velocity file, or only the ones that I want to customize? I only want to customize the wrapper and a few other parts. In the past, I've done this using the "Layouts" admin page, and I'm really having a hard time making the transition from that overly-simplistic configuration to this very engineered approach. I have to say that the docs I've found on theme development are really poor, so I must be looking in the wrong place. So many details are left out that I couldn't possibly entrust my site's display to any theme plugin I write at the moment. Or is this simpler than I'm making it?
Again, thanks for the help!
Oct 03, 2008
Tim Moore says:
You can skip the whole "Maven and your IDE" section if you're not using one and ...You can skip the whole "Maven and your IDE" section if you're not using one and just move onto Developing your plugin and Testing your plugin. Maven downloads dependencies whenever it needs them, so if you skip the IDE setup step, it will download them whenever you first compile and package your application (just run 'mvn compile' or 'mvn package'). Or, if you follow the instructions on Developing your plugin and run 'mvn -Pplugin-debug' to test your plugin, that will go through downloading dependencies, compiling and packaging the plugin first before starting the server. In general, when you run most Maven commands it will figure out what needs to be done first and make sure it's all done in the right order. You can find out more about it at http://maven.apache.org/guides/index.html
For your theme, you only need to include Velocity files that you're overriding. All of the theme documentation is at Theme Plugins and I agree it's a little spare on details, but I think the best way to learn is to look at the example theme plugins linked from that page. All of our theme plugins are available from our public Subversion repository so you can check out the way they do things to get a better idea of how it all works.
Thanks for your feedback! I'll think about how the docs can be reworded to make it more obvious that the IDE setup is totally optional. Good luck with your plugin. You might also want to look at the Confluence development forum at http://forums.atlassian.com — it's a great place to get help.
Oct 07, 2008
Jeff Kirby says:
Can I run 'mvn -PpluginDebug' and have JIRA 3.13 be my version rather than 3...Can I run 'mvn -PpluginDebug' and have JIRA 3.13 be my version rather than 3.12?
Oct 07, 2008
Jeff Kirby says:
Never mind. I figured it out. I added these properties to my pom.xml <...Never mind. I figured it out. I added these properties to my pom.xml
Ouch. Looks like a lot of changes to the code base.
Oct 16, 2008
Espog says:
hello everyone i'm new on confluence and i need help! i have try to follow t...hello everyone i'm new on confluence and i need help! i have try to follow the "How to build an atlassian plugin"
have install maven2.0.8; tomcat5.5.x; and confluence and its working, allready make a "hello world macro", but the plugin is killing me! i run "mvn compile" and i got
root@espog-laptop:~/1pl/awesome-macro# mvn install
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/com/atlassian/confluence/plugin/base/confluence-plugin-base/13/confluence-plugin-base-13.pom
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: com.acme.confluence.plugins:awesome-macro:atlassian-plugin:1.0-SNAPSHOT
Reason: Cannot find parent: com.atlassian.confluence.plugin.base:confluence-plugin-base for project: com.acme.confluence.plugins:awesome-macro:atlassian-plugin:1.0-SNAPSHOT for project com.acme.confluence.plugins:awesome-macro:atlassian-plugin:1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.atlassian.confluence.plugin.base:confluence-plugin-base for project: com.acme.confluence.plugins:awesome-macro:atlassian-plugin:1.0-SNAPSHOT for project com.acme.confluence.plugins:awesome-macro:atlassian-plugin: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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
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.confluence.plugin.base:confluence-plugin-base for project: com.acme.confluence.plugins:awesome-macro:atlassian-plugin:1.0-SNAPSHOT for project com.acme.confluence.plugins:awesome-macro:atlassian-plugin: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
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'com.atlassian.confluence.plugin.base:confluence-plugin-base' not found in repository: Unable to download the artifact from any repository
com.atlassian.confluence.plugin.base:confluence-plugin-base:pom:13
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project com.atlassian.confluence.plugin.base:confluence-plugin-base
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:571)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1255)
... 17 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
com.atlassian.confluence.plugin.base:confluence-plugin-base:pom:13
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:206)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:73)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:524)
... 18 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:324)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:194)
... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Thu Oct 16 16:40:13 WEST 2008
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------
perhaps its a simple thing that i didnt make!
thanks in advance
Oct 20, 2008
Jonathan Nolen says:
Looks like you're not using the correct settings.xml.Looks like you're not using the correct settings.xml.
Oct 24, 2008
Espog says:
Thank you Jonathan for the tip, but i manage to use a different pom and it has c...Thank you Jonathan for the tip, but i manage to use a different pom and it has compiled the "awesome-macro", and i get to see "Hello World"
by the way i use the questionniki pom.xml - it was the only one that works! can anyone tell me why!?
Thank you once more.
Dec 08, 2008
Tim McDougall says:
In the Developing your plugin section we are directed to the development/test/de...In the Developing your plugin section we are directed to the development/test/debug cycle page that addresses testing a completed plugin. Aren't we missing the step of actually writing the plugin? I don't think that is addressed anywhere in this guide. In fact, development/test/debug cycle starts out by stating: "We're not going to discuss the details of what you need to do...we'll leave that for the product specific plugin guides." First, does anyone know where these product specific guides are? (I am trying to write for Confluence) Second, wouldn't it be better to put the links to those pages in the "Developing your plugin section"?
Jan 01, 2009
Wayne Le-Trung says:
Hello, On my first attempt to build a JIRA plugin I followed the guide in 'How T...Hello,
On my first attempt to build a JIRA plugin I followed the guide in 'How To Build An Atlassian Plugin' and managed to get the skeleton code produced. I am using IDEA tool for development and have tried the command 'mvn idea:idea' but kept having errors thrown back.
I noticed that in the produced 'pom.xml' file the artifact 'atlassian-plugin-base' uses version 13 which does not exist anywhere in any repository. A search on Google indicated it was in https://maven.atlassian.com/contrib but I had to manually downloaded it and placed it in my local repository. The same command was executed and another error indicated that this time the parent artifact 'atlassian-plugin-pom' of version 9 could not be found and in fact this time I could not find anywhere on the net.
Can anybody help me to understand what's going on and how to fix this?
Thanks.
Wayne
PS: These are errors reported:
C:\JIRA-Proj\plugin-dev\wfext1>mvn -e idea:idea
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
Downloading: https://maven.atlassian.com/contrib/com/atlassian/pom/atlassian-plu
gin-pom/9/atlassian-plugin-pom-9.pom
Downloading: https://maven.atlassian.com/repository/public/com/atlassian/pom/atl
assian-plugin-pom/9/atlassian-plugin-pom-9.pom
Downloading: https://maven.atlassian.com/maven1/com.atlassian.pom/poms/atlassian
-plugin-pom-9.pom
Downloading: http://repo1.maven.org/maven2/com/atlassian/pom/atlassian-plugin-po
m/9/atlassian-plugin-pom-9.pom
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: com.atlassian.jira.plugins:jira-plugin-base:pom:13
Reason: Cannot find parent: com.atlassian.pom:atlassian-plugin-pom for project:
com.atlassian.jira.plugins:jira-plugin-base:pom:13 for project com.atlassian.jir
a.plugins:jira-plugin-base:pom:13
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: com.atlass
ian.pom:atlassian-plugin-pom for project: com.atlassian.jira.plugins:jira-plugin
-base:pom:13 for project com.atlassian.jira.plugins:jira-plugin-base:pom:13
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.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.pom:atlassian-plugin-pom for project: com.atlassian.jira.plugins
:jira-plugin-base:pom:13 for project com.atlassian.jira.plugins:jira-plugin-base
:pom:13
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(D
efaultMavenProjectBuilder.java:1370)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(D
efaultMavenProjectBuilder.java:1387)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(Def
aultMavenProjectBuilder.java:821)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFi
leInternal(DefaultMavenProjectBuilder.java:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMave
nProjectBuilder.java:198)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'com.atlassian
.pom:atlassian-plugin-pom' not found in repository: Unable to download the artif
act from any repository
com.atlassian.pom:atlassian-plugin-pom:pom:9
from the specified remote repositories:
atlassian-m1-repository (https://maven.atlassian.com/maven1),
atlassian-public (https://maven.atlassian.com/repository/public),
central (http://repo1.maven.org/maven2),
atlassian-contrib-repository (https://maven.atlassian.com/contrib)
for project com.atlassian.pom:atlassian-plugin-pom
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepo
sitory(DefaultMavenProjectBuilder.java:603)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(D
efaultMavenProjectBuilder.java:1366)
... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable
to download the artifact from any repository
com.atlassian.pom:atlassian-plugin-pom:pom:9
from the specified remote repositories:
atlassian-m1-repository (https://maven.atlassian.com/maven1),
atlassian-public (https://maven.atlassian.com/repository/public),
central (http://repo1.maven.org/maven2),
atlassian-contrib-repository (https://maven.atlassian.com/contrib)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(De
faultArtifactResolver.java:212)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(De
faultArtifactResolver.java:74)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepo
sitory(DefaultMavenProjectBuilder.java:556)
... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to downl
oad the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(Def
aultWagonManager.java:331)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(De
faultArtifactResolver.java:200)
... 21 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 4 seconds
[INFO] Finished at: Fri Jan 02 11:09:44 EST 2009
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------
C:\JIRA-Proj\plugin-dev\wfext1>
Jan 02, 2009
Jonathan Nolen says:
Hi Wayne, Are you sure that you are using the correct settings.xml.Hi Wayne,
Are you sure that you are using the correct settings.xml.
Jan 04
Wayne Le-Trung says:
Hello Jonathan, I used the same settings.xml as shown in your article. Neverthe...Hello Jonathan,
I used the same settings.xml as shown in your article. Nevertheless I browsed through the forum and found out that somebody (on entirely different topics) had used a different proxy at m2proxy.atlassian.com and I had ago with it and it worked. However I still don't know why I could not download some of the pom files via maven but had to manually download from the site. Any idea?
Regards,
Wayne
Jan 15
Kevin Ross says:
As attempted with Bamboo: In the instructions for installation of the source co...As attempted with Bamboo:
In the instructions for installation of the source code, each module displays:
I was able to ensure attachment and installation locally by adding the following to the bulid/plugins section of the aggregation pom.xml:
I doubt this would be recommended for atlassian to change in the pom as it would provide for general distribution of the source code, BUT, I believe atlassian should provide a way as the process described above does not work.
As a side note, for some reason, using mvn eclipse:eclipse is not attaching the sources. I don't have a problem doing this with other projects, it may be a configuration somewhere in the pom that is not allowing it. This isn't a big deal as it is easy enough to manually attach as necessary, but nonetheless an annoyance that could probably work out of the box.
Jan 20
Kevin Ross says:
When attempting mvn source:jar install -Dmaven.test.skip=true The same ...When attempting
mvn source:jar install -Dmaven.test.skip=trueThe same
Is appearing many times. I attempted the same workaround I used for bamboo, though most of the source jars i.e. confluence core did not make it into the local repository. It appears something is not configured properly in the confluence 2.10.1 source distribution poms.
Jan 23
Roberto Dominguez says:
Hey Tim, thanx for updating on having to copy the packaged source code to the re...Hey Tim, thanx for updating on having to copy the packaged source code to the repository... I always thought I had done something wrong
I guess the same javadocs,
Hey Jonathan, is there a chance go get that done in the maven plugin itself? There are lots of source packages and the Idea project already have the source path attached
Roberto
Jan 23
Tim Moore says:
Roberto, We're working on a solution to get it to install automatically. I just...Roberto,
We're working on a solution to get it to install automatically. I just fixed up the docs for the meantime so they're not misleading.
Jan 28
Thomas Dudziak says:
Unfortunately, the maven archetype does not work for me - the generated pom refe...Unfortunately, the maven archetype does not work for me - the generated pom references a parent pom (com.atlassian.jira.plugins:jira-plugin-base:13) that references 6 artifacts that cannot be found anywhere (I created http://jira.atlassian.com/browse/JRA-16341).
Mar 31
Royce Wong says:
Can't see this ticket...Can't see this ticket...
Mar 31
Thomas Dudziak says:
Looks like somebody moved it to http://jira.atlassian.com/browse/RELENG-171 whic...Looks like somebody moved it to http://jira.atlassian.com/browse/RELENG-171 which is private.
Feb 11
Conversión Magro says:
Hi there!, I'm quite new to maven and I was trying to simply point to the repo...Hi there!,
I'm quite new to maven and I was trying to simply point to the repo within eclipse using the m2eclipse plugin.
No luck, this is what I got:
[WARN] Error reading archetype catalog http://maven.atlassian.com/repository/public Unable to locate resource in repository I guess it's because you're using archiva.That was my second try, first I tried from the command line, following the steps indicated in the doc and this is what I got:
Please help!!! I'm dying to develop some plugins for jira
thanks
Mar 04
Stefan Wolf says:
I want to develop a plugin for Confluence 2.5.8. I carefully followed the steps ...I want to develop a plugin for Confluence 2.5.8. I carefully followed the steps to test the plugin skeleton as base for further development. Maven is working, mvn eclipse:eclipse was also successful. I installed java.mail and javax.activation as described but am now facing a new problem: The last artifact that is missing is confluence-plugin-test-resources 2.5.8 :
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.atlassian.confluence.plugins:confluence-plugin-test-resources:zip:2.5.8
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.atlassian.confluence.plugins -Darti
factId=confluence-plugin-test-resources -Dversion=2.5.8 -Dpackaging=zip -Dfile=/
path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.atlassian.confluence.plugins -Dartifa
ctId=confluence-plugin-test-resources -Dversion=2.5.8 -Dpackaging=zip -Dfile=/pa
th/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) profilexport:testplugin:atlassian-plugin:1.0-SNAPSHOT
2) com.atlassian.confluence.plugins:confluence-plugin-test-resources:zip :2.5.8
I searched in the repos but I only found the versions 2.5 and 2.6 (and higher) of the above mentioned artifact. None of those worked (as I assumed).
I'm working with the example settings.xml and the properties in my pom.xml look like this:
<properties>
<atlassian.plugin.key>profilexport.testplugin</atlassian.plugin.key>
<atlassian.product.version>2.5.8</atlassian.product.version>
<atlassian.product.test-lib.version>1.4.1</atlassian.product.test-lib.version>
<atlassian.product.data.version>2.5.8</atlassian.product.data.version>
</properties>
I assume there might be a mistake in the version numbers I entered. I'm pretty sure about the atlassion.product.version since I'm working with Confluence 2.5.8, but I'm not sure about the other two figures: atlassian.product.test-lib.version and atlassian.product.data.version ... though I don't have any clue what else to enter there.
Any hints appreciated.
Mar 04
Stefan Wolf says:
I should have followed my lead concerning the pom.xml figures before I wrote the...I should have followed my lead concerning the pom.xml figures before I wrote the comment above, I was sooo close! Well, maybe someone else encounters the same problem. In that case - here's the solution:
Set the atlassian.product.data.version to 2.5 (instead of 2.5.8). Then the properties in pom-xml should look like this (also added atlassian.product.context but I don't think it made a difference):
<properties>
<atlassian.plugin.key>profilexport.testplugin</atlassian.plugin.key>
<atlassian.product.version>2.5.8</atlassian.product.version>
<atlassian.product.data.version>2.5</atlassian.product.data.version>
<atlassian.product.test-lib.version>1.4.1</atlassian.product.test-lib.version>
<atlassian.product.context>confluence</atlassian.product.context>
</properties>
Now everything works as is should.