Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,994
Community Members
 
Community Events
165
Community Groups

Can't get Sriptrunner sample plugins to work

Hi,

I am quite new to plugin developlment in Jira and have tried setting up an environment for testing code as explained in the Script Runner documentation: https://scriptrunner.adaptavist.com/6.10.0/jira/testing.html

I managed to set up the system, but fail when it comes to running "mvn jira:debug".

Maven fails at some point with the following error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.240 s
[INFO] Finished at: 2020-10-06T08:35:04+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.maven.plugins:jira-maven-plugin:8.1.1:debug (default-cli) on project sr-sample
-plugin-jira: Unable to get the POM for the artifact 'com.atlassian.jira:atlassian-jira-webapp:8.0.0'. Verify the artifact
parameter.: Some problems were encountered while processing the POMs:
[ERROR] [ERROR] Unresolveable build extension: Plugin com.atlassian.maven.plugins:artifactory-staging-maven-plugin:2.0.0 or
one of its dependencies could not be resolved: Failure to find com.atlassian.maven.plugins:artifactory-staging-maven-plugi
n:jar:2.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted
until the update interval of central has elapsed or updates are forced @: 1 problem was encountered while building the effe
ctive model for com.atlassian.jira:atlassian-jira-webapp:8.0.0
[ERROR] [ERROR] Unresolveable build extension: Plugin com.atlassian.maven.plugins:artifactory-staging-maven-plugin:2.0.0 or
one of its dependencies could not be resolved: Failure to find com.atlassian.maven.plugins:artifactory-staging-maven-plugi
n:jar:2.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted
until the update interval of central has elapsed or updates are forced @
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.atlassian.maven.plugins:jira-maven-plugi
n:8.1.1:debug (default-cli) on project sr-sample-plugin-jira: Unable to get the POM for the artifact 'com.atlassian.jira:at
lassian-jira-webapp:8.0.0'. Verify the artifact parameter.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:5
6)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to get the POM for the artifact 'com.atlassian.jira:atlas
sian-jira-webapp:8.0.0'. Verify the artifact parameter.
at org.apache.maven.plugins.help.AbstractHelpMojo.getMavenProject (AbstractHelpMojo.java:222)
at org.apache.maven.plugins.help.EffectivePomMojo.execute (EffectivePomMojo.java:113)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo (MojoExecutor.java:119)
at com.atlassian.maven.plugins.amps.util.MojoUtils.execute (MojoUtils.java:36)
at com.atlassian.maven.plugins.amps.util.MojoUtils.executeWithMergedConfig (MojoUtils.java:66)
at com.atlassian.maven.plugins.amps.MavenGoals.generateEffectivePom (MavenGoals.java:2031)
at com.atlassian.maven.plugins.amps.product.AbstractWebappProductHandler.addOverridesFromProductPom (AbstractWebappProd
uctHandler.java:150)
at com.atlassian.maven.plugins.amps.product.AbstractProductHandler.start (AbstractProductHandler.java:84)
at com.atlassian.maven.plugins.amps.RunMojo.startProducts (RunMojo.java:137)
at com.atlassian.maven.plugins.amps.DebugMojo.doExecute (DebugMojo.java:86)
at com.atlassian.maven.plugins.amps.AbstractProductHandlerMojo.execute (AbstractProductHandlerMojo.java:782)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:5
6)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin com.atlassian.maven.plugins:artifactory-staging-maven-plugin:2.0.0 or one of
its dependencies could not be resolved: Failure to find com.atlassian.maven.plugins:artifactory-staging-maven-plugin:jar:2.
0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until th
e update interval of central has elapsed or updates are forced @

at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:207)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:124)
at org.apache.maven.plugins.help.AbstractHelpMojo.getMavenProject (AbstractHelpMojo.java:218)
at org.apache.maven.plugins.help.EffectivePomMojo.execute (EffectivePomMojo.java:113)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo (MojoExecutor.java:119)
at com.atlassian.maven.plugins.amps.util.MojoUtils.execute (MojoUtils.java:36)
at com.atlassian.maven.plugins.amps.util.MojoUtils.executeWithMergedConfig (MojoUtils.java:66)
at com.atlassian.maven.plugins.amps.MavenGoals.generateEffectivePom (MavenGoals.java:2031)
at com.atlassian.maven.plugins.amps.product.AbstractWebappProductHandler.addOverridesFromProductPom (AbstractWebappProd
uctHandler.java:150)
at com.atlassian.maven.plugins.amps.product.AbstractProductHandler.start (AbstractProductHandler.java:84)
at com.atlassian.maven.plugins.amps.RunMojo.startProducts (RunMojo.java:137)
at com.atlassian.maven.plugins.amps.DebugMojo.doExecute (DebugMojo.java:86)
at com.atlassian.maven.plugins.amps.AbstractProductHandlerMojo.execute (AbstractProductHandlerMojo.java:782)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:5
6)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective m
odel for com.atlassian.jira:atlassian-jira-webapp:8.0.0
[ERROR] Unresolveable build extension: Plugin com.atlassian.maven.plugins:artifactory-staging-maven-plugin:2.0.0 or one of
its dependencies could not be resolved: Failure to find com.atlassian.maven.plugins:artifactory-staging-maven-plugin:jar:2.
0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until th
e update interval of central has elapsed or updates are forced @

at org.apache.maven.model.building.DefaultModelProblemCollector.newModelBuildingException (DefaultModelProblemCollector
.java:197)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:498)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:440)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:430)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:173)
at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:124)
at org.apache.maven.plugins.help.AbstractHelpMojo.getMavenProject (AbstractHelpMojo.java:218)
at org.apache.maven.plugins.help.EffectivePomMojo.execute (EffectivePomMojo.java:113)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo (MojoExecutor.java:119)
at com.atlassian.maven.plugins.amps.util.MojoUtils.execute (MojoUtils.java:36)
at com.atlassian.maven.plugins.amps.util.MojoUtils.executeWithMergedConfig (MojoUtils.java:66)
at com.atlassian.maven.plugins.amps.MavenGoals.generateEffectivePom (MavenGoals.java:2031)
at com.atlassian.maven.plugins.amps.product.AbstractWebappProductHandler.addOverridesFromProductPom (AbstractWebappProd
uctHandler.java:150)
at com.atlassian.maven.plugins.amps.product.AbstractProductHandler.start (AbstractProductHandler.java:84)
at com.atlassian.maven.plugins.amps.RunMojo.startProducts (RunMojo.java:137)
at com.atlassian.maven.plugins.amps.DebugMojo.doExecute (DebugMojo.java:86)
at com.atlassian.maven.plugins.amps.AbstractProductHandlerMojo.execute (AbstractProductHandlerMojo.java:782)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:5
6)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

I am sort of lost at the moment where to start looking how to resolve this, so any directions are highly appreciated.

Thank you,

Anna

2 answers

1 accepted

Hi Anna,

It seems like Maven doesn't find the Atlassian dependencies it needs and a quick scan of the repository mentioned in your error report shows that, that particular dependency is not in that repo.

If you are familiar with Maven you could add a repository to your POM file, so Maven knows where to look for those artifacts. Here is a repo which has those artifacts:
https://mvnrepository.com/artifact/com.atlassian.maven.plugins/jira-maven-plugin

Another, better way if you are going to do development on Atlassian products, is to install the Atlassian SDK which itself adds repositories to the Maven config, so it can find that Atlassian dependencies.
Here is a guide on how to install the SDK:
https://developer.atlassian.com/server/framework/atlassian-sdk/set-up-the-atlassian-plugin-sdk-and-build-a-project/


Let me now if you get there!

Jeroen

Hi Jeroen,

thank you for your answer.

The reason why I used the Script Runner instruction is actually that I would like to create a test suite which I can run when updating plugins, to ensure that they still work as intended in our environment. So I had hoped to be fine with what script runner provided in their tutorial.

And no - I am not very familiar with maven yet. My first guess was to add the dependency 

<!-- https://mvnrepository.com/artifact/com.atlassian.maven.plugins/jira-maven-plugin -->
<dependency>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>jira-maven-plugin</artifactId>
<version>8.1.1</version>
</dependency>

to the <dependencies> section of the pom.xml

Unfortunately I am now getting warnings and ultimately an error about banned dependencies... :

[INFO] --- jira-maven-plugin:8.1.1:validate-banned-dependencies (default-validate-banned-dependencies) @ sr-sample-plugin-jira ---
[INFO] validate banned dependencies
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
make sure platform artifacts are not bundled into plugin
Found Banned Dependency: dom4j:dom4j:jar:1.4
Found Banned Dependency: com.google.guava:guava:jar:26.0-jre
Found Banned Dependency: io.atlassian.fugue:fugue:jar:4.7.2
Found Banned Dependency: org.apache.httpcomponents:httpclient:jar:4.5.5
Found Banned Dependency: biz.aQute.bnd:biz.aQute.bndlib:jar:3.5.0
Found Banned Dependency: org.slf4j:slf4j-api:jar:1.7.25
Found Banned Dependency: org.springframework:spring-core:jar:5.0.10.RELEASE
Found Banned Dependency: com.google.code.findbugs:jsr305:jar:3.0.0
Found Banned Dependency: org.apache.httpcomponents:httpcore:jar:4.4.9
Found Banned Dependency: commons-io:commons-io:jar:2.6
Found Banned Dependency: org.slf4j:slf4j-simple:jar:1.7.22
Found Banned Dependency: org.apache.commons:commons-lang3:jar:3.8
Found Banned Dependency: org.springframework:spring-tx:jar:5.0.10.RELEASE
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.955 s
[INFO] Finished at: 2020-10-08T10:07:56+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.maven.plugins:jira-maven-plugin:8.1.1:validate-banned-dependencies (default-validate-banned-dependencies) on project sr-sample-plugin-jira: Some Enforcer rul
es have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

 

So I guess I either have to install the Atlassian SKD as you suggested or force Adaptavist to fix theiry examples. As a side note, the bamboo sample works, jira, confluence and bitbucket don't.

Anna

Hi Jeroen,

thank you for your answer. The goal that I currently trying to achieve is to automate some testing around Jira, especially when we update the plugins we use - to make sure that they still work as intended in our environment. This is why I used the Script Runner samples from their website. It's good to hear that installing the Atlassian SDK solves the problem, but I'd like to keep the setup small - unless there is no other solution.

I am not very familiar with Maven yet, so I tried to add the repository to my pom file by adding a new dependency:

<dependency>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>jira-maven-plugin</artifactId>
<version>8.1.1</version>
</dependency>

I am now getting errors about banned dependencies, so I don't think that what I did was correct:

[INFO] --- jira-maven-plugin:8.1.1:validate-banned-dependencies (default-validate-banned-dependencies) @ sr-sample-plugin-jira ---
[INFO] validate banned dependencies
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
make sure platform artifacts are not bundled into plugin
Found Banned Dependency: dom4j:dom4j:jar:1.4
Found Banned Dependency: com.google.guava:guava:jar:26.0-jre
Found Banned Dependency: io.atlassian.fugue:fugue:jar:4.7.2
Found Banned Dependency: org.apache.httpcomponents:httpclient:jar:4.5.5
Found Banned Dependency: biz.aQute.bnd:biz.aQute.bndlib:jar:3.5.0
Found Banned Dependency: org.slf4j:slf4j-api:jar:1.7.25
Found Banned Dependency: org.springframework:spring-core:jar:5.0.10.RELEASE
Found Banned Dependency: com.google.code.findbugs:jsr305:jar:3.0.0
Found Banned Dependency: org.apache.httpcomponents:httpcore:jar:4.4.9
Found Banned Dependency: commons-io:commons-io:jar:2.6
Found Banned Dependency: org.slf4j:slf4j-simple:jar:1.7.22
Found Banned Dependency: org.apache.commons:commons-lang3:jar:3.8
Found Banned Dependency: org.springframework:spring-tx:jar:5.0.10.RELEASE
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.955 s
[INFO] Finished at: 2020-10-08T10:07:56+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.maven.plugins:jira-maven-plugin:8.1.1:validate-banned-dependencies (default-validate-banned-dependencies) on project sr-sample-plugin-jira: Some Enforcer rul
es have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

 

I may have to invest more time in understanding Maven I guess - or see if Adaptavist fixes their git repository. This still feels a little bit like digging in the fog :-/

In case I am missing something very basic when adding the repo I will be happy about any further "instructions" and give it another try ;-)

Anna

Hi Anna,

 

What you added to your POM is a separate dependency which Maven does not find, so you should remove that dependency.

What you could add to your POM file is the ATL Repository (above the <dependencies> tag)

<repository> 
<id>atlassian-public</id>
<url>https://packages.atlassian.com/mvn/maven-external/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>

This way you tell Maven to go look at this repo also.

However this may work locally, I do recommend installing the Atlassian SDK as it makes it easy to locally startup instances for the Atlassian products + in different versions, which is great for initial testing on breaking changes.

 

Let me know if this helps!

 

Regards,

Jeroen

Hi Anna,

Adding that dependency is not going to fix it since Maven does not know where to get it, so you should remove the added code there.

Try adding the atlassian repo to you POM (before the <dependencies> tag)

<repository>
<id>atlassian-public</id>
<url>https://packages.atlassian.com/mvn/maven-external/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
 

 This should fix the build.

 

However this may work, I do recommend using the Atlassian SDK as it also lets you spin up local instances of Atlassian products in different versions, which is great for initial testing on breaking changes.

 

Let me know if this works!

 

Regards,

Jeroen

Hi Jeroen,

it actually turned out, that - after contacting Adaptavist support - there was a wrong version of the script-runner-standard artifact ID referenced in the pom.xml that I downloaded from the Git repository. Changing it from 31 to 29 resolved the issue.

So thanks again for your thorough support here :-)

Anna

Like # people like this

Hi Anna,

Glad to hear your problem is fixed! Kindly accept the answer so other users with similar problem can also benefit from the solution here.

 

Kind regards,

 

Jeroen

https://docs.adaptavist.com/sr4js/latest/best-practices/write-code/set-up-a-dev-environment

ScriptRunner instructions still do not work as provided, even today.

No matter what jira version I use, I get:

Unable to get the POM for the artifact com.atlassian.jira:atlassian-jira-webapp

Hi @Derek White ,

Could you replace the pom.xml that that was provided with the pom.xml below and let me know if it works for you? :

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <modelVersion>4.0.0</modelVersion>
    <packaging>atlassian-plugin</packaging>

    <parent>
        <groupId>com.adaptavist.pom</groupId>
        <artifactId>scriptrunner-jira-standard</artifactId>
        <version>31</version>
        <relativePath/>
    </parent>

    <groupId>com.onresolve.scriptrunner.assets</groupId>
    <artifactId>sr-sample-plugin-jira</artifactId>
    <version>1.2-SNAPSHOT</version>

    <organization>
        <name>Example Company</name>
        <url>http://www.example.com/</url>    </organization>

    <name>Jira Sample Plugin for ScriptRunner</name>
    <description>ScriptRunner for Jira script plugin</description>

    <properties>
        <!-- Set your JIRA version here -->
        <jira.version>8.5.7</jira.version>
        <scriptrunner.version>5.6.15.1-p5</scriptrunner.version>
        <!-- Set logging levels for development here -->
        <logging.levels>com.example;DEBUG,com.onresolve;DEBUG</logging.levels>
    </properties>

    <dependencies>
        <!-- The parent pom adds some standard dependencies, but you can add additional ones here -->
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <configuration>
                    <jvmArgs>-Xms512m -Xmx1g -XX:MaxPermSize=1g -XX:-UseGCOverheadLimit -server</jvmArgs>
                    <applications>
                        <!-- Uncomment these if you wish to include them -->

                        <!-- Include Jira Software features -->
                        <!--
                        <application>
                            <applicationKey>jira-software</applicationKey>
                            <version>${jira.software.version}</version>
                        </application>
                        -->

                        <!-- Include Jira Service Desk features -->
                        <!--
                        <application>
                            <applicationKey>jira-servicedesk</applicationKey>
                            <version>${jira.servicedesk.version}</version>
                        </application>
                        -->
                    </applications>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <!-- This is required to find the parent pom and ScriptRunner dependencies -->
        <repository>
            <id>adaptavist-external</id>
            <url>https://nexus.adaptavist.com/content/repositories/external</url>            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>fail</checksumPolicy>
            </releases>
        </repository>
    </repositories>
</project>

Please note that you would need to execute mvn clean to clean the directory then execute the command mvn jira:debug in the jira directory of the repository to rebuild the project

If there are any other errors after replacing it with the above, please let me know here and I will investigate

 

This works perfectly. When I try to change the POM file to use jira 8.13.13 it breaks. Can you tell us me how to get the latest Jira version and ScriptRunner version. @Der Lun _Adaptavist_ 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

15,048 views 38 49
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you