hook development in continuous integration environment

We have checked our stash hooks into a git repository. Upon checkin, the post-receive hook kicks off a build in our jenkins environment. When the build gets executed we get errors similar to the following:

[ERROR] 'dependencies.dependency.version' for com.atlassian.stash:stash-api:jar is missing. @ line 28, column 21

I have gone into https://maven.atlassian.com/content/groups/public/com/ and done a mvn install to install an appropriate jar file(the correct version 2.2.0) such as stash-api-2.2.0.jar

Is there a better way to get all of the correct dependencies installed? We are concerned that running atlas-create-stash-plugin from the atlassian-plugin-sdk-4.1.6 will overwrite other versions of packages we have installed.

4 answers

Hi Kevin,

I'm fairly certain that's related purely to your pom.xml configuration, and not the install dependencies. Have you specified the version of stash-api that you want? Your pom.xml should contain an entry like this:


You might also want to take a look at some of our Stash plugin examples on Bitbucket which use the dependencyManagement to include stash-parent, which then allows you to omit the version on stash dependencies.

After that running the normal 'mvn package' or 'mvn install' should download all the required dependencies and then compile/test your hook.

I hope this helps. If not please post your pom.xml so we can take a look


Charles, thank you for looking at this.

Here is the pom. After a number of mvn installs, the build error on jenkins is a java stacktrace:

Building Stash 1.0
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-stash-plugin:4.1.6:copy-bundled-dependencies (default-copy-bundled-dependencies) @ Stash --- Apr 18, 2013 1:58:56 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: com.atlassian.maven.plugins.stash.StashCopyBundledDependenciesMojo
java.lang.TypeNotPresentException: Type com.atlassian.maven.plugins.stash.StashCopyBundledDependenciesMojo not present
	at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:109)
Caused by: java.lang.NoClassDefFoundError: com/atlassian/maven/plugins/amps/CopyBundledDependenciesMojo

Here is our pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><br< a="">> <modelVersion>4.0.0</modelVersion>
<description>This is the Stash plugin for Atlassian Stash.</description>


Hi Kevin,

Hmm. That appears to work. What version of maven are you using BTW? You can/should use atlas-mvn instead, which is a wrapper around Maven 2.1.0.



Hi Charles

The jenkins box is using maven 3.0.4. Can you provide a suggestion how I would use atlas-mvn for this build?


Hi Kevin,

Apologies, you don't actually need atlas-mvn in this case (it's really for client-side development). Just ensure you have Maven 2.1.0 installed on Jenkins and your plugin should build successfully.


Hi Charles,

that worked. thanks. we also added this parameter to the jenkins build for the compile goal.


thanks again,


Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Posted Thursday in Off-topic

Friday Fun: What's your favourite beer/drink

As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...

370 views 39 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

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

Start an AUG

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

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot