Problem with atlas-run : JIRA 8.7.1 and SDK 8.0.16

Hello,
We have existing plugin which we are trying to migrate to JIRA 8.7.1. We are using latest SDK (8.0.16) and using AMPS-Version 8.0.4.
Unfortunately atlas-run gives following error and couldn’t find out root cause.


Downloading from central:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:10 min
[INFO] Finished at: 2020-02-28T14:48:59+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin com.atlassian.maven.plugins:amps-dispatcher-maven-plugin:amps.version or one of its dependencies could not be resolved: Could not find artifact com.atlassian.maven.plugins:amps-dispatcher-maven-plugin:jar:amps.version in atlassian-public (https://maven.atlassian.com/repository/public) -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin com.atlassian.maven.plugins:amps-dispatcher-maven-plugin:amps.version or one of its dependencies could not be resolved: Could not find artifact com.atlassian.maven.plugins:amps-dispatcher-maven-plugin:jar:amps.version in atlassian-public (https://maven.atlassian.com/repository/public)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:128)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:182)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor (DefaultMavenPluginManager.java:286)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor (DefaultBuildPluginManager.java:244)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor (MojoDescriptorCreator.java:239)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments (DefaultLifecycleTaskSegmentCalculator.java:104)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments (DefaultLifecycleTaskSegmentCalculator.java:83)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:89)
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:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.atlassian.maven.plugins:amps-dispatcher-maven-plugin:jar:amps.version in atlassian-public

at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:224)

Best Regards

Hi @SanjayPatel,

please show us the pom.xml file as it is likely the root cause of your problem.
The line com.atlassian.maven.plugins:amps-dispatcher-maven-plugin:jar:amps.version seems to indicate that it is looking for a version named amps.version - which of course cannot be found.

Hi @dennis.fischer ,
I could make progress by using atlas-run -u 8.0.2 explicitly.
Don’t know why it doesn’t work without -u flag.

Thanks.

Hi there,

I have the same problem like the thread owner.
Passing -u 8.0.2 works.

Here is my pom.xml


<?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>
	<groupId>com.company</groupId>
	<artifactId>timeTrack</artifactId>
	<version>1.3.2-Release</version>
	<organization>
		<name>EK GmbH</name>
		<url>https://someurl.com/</url>
	</organization>
	<name>timeTrack</name>
	<description>Plugin to do time tracking in Navision</description>
	<packaging>atlassian-plugin</packaging>
	<repositories>
		<repository>
			<id>atlassian-public</id>
			<url>https://maven.atlassian.com/repository/public</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>com.sun.jersey</groupId>
			<artifactId>jersey-client</artifactId>
			<version>1.8-atlassian-11</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20180130</version>
		</dependency>
		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-api</artifactId>
			<version>${jira.version}</version>
			<scope>provided</scope>
			<exclusions>
				<exclusion>
					<groupId>jta</groupId>
					<artifactId>jta</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<!-- Add dependency on jira-core if you want access to JIRA implementation 
			classes as well as the sanctioned API. -->
		<!-- This is not normally recommended, but may be required eg when migrating 
			a plugin originally developed against JIRA 4.x -->
		<!-- <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-core</artifactId> 
			<version>${jira.version}</version> <scope>provided</scope> </dependency> -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.plugin</groupId>
			<artifactId>atlassian-spring-scanner-annotation</artifactId>
			<version>${atlassian.spring.scanner.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.plugin</groupId>
			<artifactId>atlassian-spring-scanner-runtime</artifactId>
			<version>${atlassian.spring.scanner.version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
			<scope>provided</scope>
		</dependency>
		<!-- WIRED TEST RUNNER DEPENDENCIES -->
		<dependency>
			<groupId>com.atlassian.plugins</groupId>
			<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
			<version>${plugin.testrunner.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>jsr311-api</artifactId>
			<version>1.1.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.2.2-atlassian-1</version>
		</dependency>
		<!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit -->
		<!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit -->
		<!-- <dependency> <groupId>com.atlassian.jira.tests</groupId> <artifactId>jira-testkit-client</artifactId> 
			<version>${testkit.version}</version> <scope>test</scope> </dependency> -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.6.6</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.8.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.activeobjects</groupId>
			<artifactId>activeobjects-plugin</artifactId>
			<version>${ao.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.1.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>com.atlassian.maven.plugins</groupId>
				<artifactId>jira-maven-plugin</artifactId>
				<version>${amps.version}</version>
				<extensions>true</extensions>
				<configuration>
					<productVersion>${jira.version}</productVersion>
					<productDataVersion>${jira.version}</productDataVersion>
					<!-- Uncomment to install TestKit backdoor in JIRA. -->
					<!--
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira.tests</groupId>
                            <artifactId>jira-testkit-plugin</artifactId>
                            <version>${testkit.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    -->
					<enableQuickReload>true</enableQuickReload>
					<!--                    <enableFastdev>false</enableFastdev>-->
					<!-- See here for an explanation of default instructions: -->
					<!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
					<instructions>
						<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
						<!-- Add package to export here -->
						<Export-Package>swql.eurofunk.timeTrack.api,</Export-Package>
						<!-- Add package import here -->
						<Import-Package>org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
						<!-- Ensure plugin is spring powered -->
						<Spring-Context>*</Spring-Context>
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.atlassian.plugin</groupId>
				<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
				<version>${atlassian.spring.scanner.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>atlassian-spring-scanner</goal>
						</goals>
						<phase>process-classes</phase>
					</execution>
				</executions>
				<configuration>
					<includeExclude>-com.atlassian.plugin.spring.scanner.annotation.*</includeExclude>
					<scannedDependencies>
						<dependency>
							<groupId>com.atlassian.plugin</groupId>
							<artifactId>atlassian-spring-scanner-external-jar</artifactId>
						</dependency>
					</scannedDependencies>
					<verbose>false</verbose>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<properties>
		<jira.version>7.13.5</jira.version>
		<ao.version>1.2.3</ao.version>
		<amps.version>8.0.2</amps.version>
		<plugin.testrunner.version>2.0.1</plugin.testrunner.version>
		<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
		<!-- This property ensures consistency between the key in atlassian-plugin.xml and the OSGi bundle's key. -->
		<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
		<!-- TestKit version 6.x for JIRA 6.x -->
		<testkit.version>6.3.11</testkit.version>
		<project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
		<!--        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>-->
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>
</project>

Hi,
Had the same issue, because of my pom.xml “format” action. (space replaced by tabs)

The issuing lines are these one in the “atlas-run.bat” :

if exist pom.xml (
    echo [INFO] Project POM found
    for /F "delims=*" %%a in ('findstr "<amps.version>" pom.xml') do (set var="%%a")
    for /F "tokens=2 delims=>< " %%a in (!var!) do (set AMPS_PLUGIN_VERSION=%%a)
)

So, in order to fix this quickly, I just added another for /F in order to delimit by the default value (tab).

if exist pom.xml (
    echo [INFO] Project POM found
    for /F "delims=*" %%a in ('findstr "<amps.version>" pom.xml') do (set var="%%a")
    for /F %%a in (!var!) do (set vartab="%%a")
    for /F "tokens=2 delims=>< 	" %%a in (!vartab!) do (set AMPS_PLUGIN_VERSION=%%a)
)

I don’t know if it is the best fix, but it works in any case.

Regards.