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

SDK atlas-run vs atlas-run-standalone and stash

Matthew Lesko December 12, 2013

I am attempting to use the SDK to develop a plugin for stash 2.8.4. However, the atlas-run and atlas-run-standalone commands differ in what version of stash they install, even _with_ the --version command.

stash-run-standalone --product stash --version 2.8.4 starts correctly.

stash-run --product stash --version 2.8.4 does not, and I believe this is because it pulls in stash-1.3.1, /regardless/ of the version passed. (With no --version it should be the most recent, no?).

leskomw at stash-dev in ~/atlas-tutorial/stash-auth-plugin-example[0] $ atlas-run --product stash
Executing: /home/leskomw/atlas-sdk/atlassian-plugin-sdk-4.2.10/apache-maven/bin/mvn com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.2.10:run -gs /home/leskomw/atlas-sdk/atlassian-plugin-sdk-4.2.10/apache-maven/conf/settings.xml -Dproduct='stash'
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building stash-kerberos
[INFO]    task-segment: [com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.2.10:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing amps-dispatcher:run
[INFO] [stash:copy-bundled-dependencies]
[INFO] [dependency:unpack-dependencies]
[INFO] [stash:compress-resources]
[INFO] Compiling javascript using YUI
[INFO] Compressing XML files
[INFO] compressing to /home/leskomw/atlas-tutorial/stash-auth-plugin-example/target/classes/atlassian-plugin.xml
[INFO] [resources:resources]
[WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [stash:filter-plugin-descriptor]
[INFO] [resources:copy-resources {execution: virtual-execution}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to /home/leskomw/atlas-tutorial/stash-auth-plugin-example/target/classes
[INFO] [stash:generate-manifest]
[INFO] No manifest instructions found, adding only non-OSGi manifest attributes
[INFO] [stash:generate-rest-docs]
[INFO] [resources:testResources]
[WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/leskomw/atlas-tutorial/stash-auth-plugin-example/src/test/resources
[INFO] [amps:filter-test-plugin-descriptor]
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [stash:unit-test]
[INFO] surefire unit-test configuration:
[INFO] <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <systemPropertyVariables/>
  <excludes>
    <exclude>it/**</exclude>
    <exclude>**/*$*</exclude>
  </excludes>
  <excludedGroups/>
</configuration>
[INFO] [surefire:test {execution: virtual-execution}]
[INFO] No tests to run.
[INFO] [stash:validate-manifest]
[INFO] Manifest found, validating...
[INFO] Manifest validated
[INFO] [stash:jar]
[INFO] [jar:jar]
[INFO] Building jar: /home/leskomw/atlas-tutorial/stash-auth-plugin-example/target/stash-kerberos-1.0-SNAPSHOT.jar
[INFO] [build-helper:attach-artifact]
[INFO] [stash:generate-obr-artifact]
[INFO] Skipping OBR generation... no OSGi bundle manifest instructions found in pom.xml
[INFO] [stash:test-jar]
[INFO] [amps-dispatcher:run]
[INFO] [stash:run {execution: virtual-execution}]
[INFO] Google Analytics Tracking is enabled to collect AMPS usage statistics.
[INFO] Although no personal information is sent, you may disable tracking by adding <allowGoogleTracking>false</allowGoogleTracking> to the amps plugin configuration in your pom.xml
[INFO] Sending event to Google Analytics: AMPS:stash - Run
[INFO]
[INFO] Starting stash...
[INFO] [dependency:copy]
[INFO] Configured Artifact: com.atlassian.stash:stash-plugin-test-resources:1.3.1:zip
[INFO] Copying stash-plugin-test-resources-1.3.1.zip to /home/leskomw/atlas-tutorial/stash-auth-plugin-example/target/stash/stash-plugin-test-resources.zip
[INFO] [dependency:copy {execution: virtual-execution}]
[INFO] Configured Artifact: com.atlassian.stash:stash-webapp:1.3.1:war



At which point the application fails to load; first because of "HTTP Status 500 - No WebApplicationContext found: no ContextLoaderListener registered?" error.

Then, if that is fixed as documented here -https://jira.atlassian.com/browse/STASH-2780 - by manually fixing web.xml with:

<     <!-- To deal with java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered on MacOS X -->
<     <listener>
<       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
<     </listener>

I get a second error one the webapp starts:


A fatal error has occurred

The following problem occurred which prevents Atlassian Stash from starting correctly:

OpenJDK 64-Bit Server VM is an unsupported JVM. Supported platforms.

Despite this page - https://confluence.atlassian.com/display/STASHKB/OpenJDK+64-Bit+Server+VM+is+an+unsupported+JVM- saying that stash-2.5 does use OpenJDK, as well as https://confluence.atlassian.com/display/STASH/Supported+platforms

I think the underlying problem is with the SDK though. Even if I'm fat-fingering the --version option, shouldn't atlas-run default to the latest (2.9) version?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Matthew Lesko December 19, 2013

Bug opened, I guess this question is "answered". https://ecosystem.atlassian.net/browse/AMPS-1071

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.
December 21, 2013

Looks like you've been talking with Jason about this on the following Stash bug:

https://jira.atlassian.com/browse/STASH-4161

0 votes
Adrien Ragot 2
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.
December 14, 2013

The answer is in your pom.xml. When you run stash-run, it mostly looks in your pom.xml. Did you specify the version there?

  • In your pom.xml, you must have either maven-amps-plugin or maven-stash-plugin, but not both.
  • Also check the parent pom.xml and its parent.
  • --version only passes a system property to Maven. Your pom.xml makes no use of it, unless you use ${product.version} somewhere.

Matthew Lesko December 17, 2013

Creating a new, empty project with atlas-create-stash-plugin && atlas-run reproduces this problem. The default pom.xml contains:

&lt;dependencyManagement&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.atlassian.stash&lt;/groupId&gt;
                &lt;artifactId&gt;stash-parent&lt;/artifactId&gt;
                &lt;version&gt;${stash.version}&lt;/version&gt;
                &lt;type&gt;pom&lt;/type&gt;
                &lt;scope&gt;import&lt;/scope&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;

and atlas-run ends with:

Matthew Lesko December 17, 2013
The same error is encountered with atlas-run --product stash --version 2.8.4.

Modifying pom.xml to:

    &lt;dependencymanagement&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;groupid&gt;com.atlassian.stash&lt;/groupid&gt;
                &lt;artifactid&gt;stash-parent&lt;/artifactid&gt;
                &lt;version&gt;2.8.4&lt;/version&gt;
                &lt;type&gt;pom&lt;/type&gt;
                &lt;scope&gt;import&lt;/scope&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
    &lt;/dependencymanagement&gt;


Succeeds.

So I'd say there are two problems here:

${stash.version} is not set by the atlas-run command line.

${stash.version}, when not set, defaults to RELEASE (source: https://developer.atlassian.com/display/DOCS/atlas-run), but RELEASE appears to be defined as stash-1.3.1, not 2.9 or 2.10.

It looks like atlas-debug --version *does* work.

Matthew Lesko December 17, 2013

It looks like this might be a known issue:

https://jira.atlassian.com/browse/STASH-2780

specifically, the Atlassian comment:

Looks like as of 4.0, the test-version argument is deprecated (well ignored actually). You need to use data-version instead.

atlas-run --product stash --version 1.3.0 --data-version 1.3.0 

This seems to run fine now. Apparently there is a fix coming in the SDK which selects the last released version, and the data-version should correspond to that.

Though clearly it hasn't yet been fixed in my version of the SDK (4.2.10).

Matthew Lesko December 17, 2013

This answers site likes to eat comments, which is annoying. This is out of order but might help someone coming here from Google.

The atlas-run --product --version 2.8.4 command (or atlas-run by itself) fails with:

[INFO] Compiling 2 source files to /home/leskomw/plugindev/demostash/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/home/leskomw/plugindev/demostash/src/main/java/com/example/MyPluginComponentImpl.java:[3,28] error: package com.atlassian.sal.api does not exist

/home/leskomw/plugindev/demostash/src/main/java/com/example/MyPluginComponentImpl.java:[7,18] error: cannot find symbol

could not parse error message:   symbol:   class ApplicationProperties
  location: class MyPluginComponentImpl
/home/leskomw/plugindev/demostash/src/main/java/com/example/MyPluginComponentImpl.java:9: error: cannot find symbol
    public MyPluginComponentImpl(ApplicationProperties applicationProperties)
                                 ^


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------

TAGS
AUG Leaders

Atlassian Community Events