Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

hook development in continuous integration environment

Kevin Mayer April 18, 2013

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

0 votes
Kevin Mayer April 21, 2013

Hi Charles,

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

DATLAS_HOME=/usr/local/atlassian_sdk_4.1.6/atlassian-plugin-sdk-4.1.6

thanks again,

Kevin

0 votes
Kevin Mayer April 19, 2013

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?

Kevin

cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2013

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.

Charles

0 votes
Kevin Mayer April 18, 2013

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] 
[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>
<groupId>oit.se.stash</groupId>
<artifactId>Stash</artifactId>
<version>1.0</version>
<organization>
<name>OITSE</name>
<url>edu/oit</url>
</organization>
<name>Stash</name>
<description>This is the Stash plugin for Atlassian Stash.</description>
<packaging>atlassian-plugin</packaging>

<dependencyManagement>
<dependencies>
<dependency>
...




































































































































cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2013

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.

Cheers,

Charles

0 votes
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2013

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:

&lt;dependency&gt;
    &lt;groupId&gt;com.atlassian.stash&lt;/groupId&gt;
    &lt;artifactId&gt;stash-api&lt;/artifactId&gt;
    &lt;version&gt;${stash.version}&lt;/version&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events