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 Sign up to answer
Community showcase
Published yesterday in Agile

How Scrum works? It starts with training and education

To answer “How scrum works,” most of the teams I've worked with first addressed the question: “where to start?”  That question applies to both implementation and improvements on the Scrum framew...

117 views 3 3
Read article

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