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

Jira 7 Plugin - No Conditions Available for Web-Items?

AlexanderR December 10, 2015

When I add the condition 'com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition' to a web-item, the plugin won't start.

 

Here the excerpt from atlassian-plugin.xml

<web-item key="my-addon-webitem" name="My Addon" section="system.user.options/personal" weight="1000">
  <description key="my_description">Show my addon</description>
  <label key="my_label"></label>
  <link linkId="my_link">/secure/MyAddon.jspa</link>
  <condition class="com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition" />
</web-item>

 

Hand here the log output:

[INFO] [talledLocalContainer] 2015-12-10 14:30:24,927 localhost-startStop-1 ERROR      [c.a.plugin.manager.DefaultPluginManager] There was an error loading the descriptor 'My Plugin' of plugin 'com.acme.jira.my-addon'. Disabling.
[INFO] [talledLocalContainer] java.lang.RuntimeException: Unable to enable web fragment
[INFO] [talledLocalContainer] 	at ...
[INFO] [talledLocalContainer] Caused by: com.atlassian.plugin.PluginParseException: Unable to load the module's display conditions: Could not load 'com.atlassian.jira.plugin.webfragment.conditions.UserIsAdminCondition' in plugin com.acme.jira.my-addon
[INFO] [talledLocalContainer] 	at ...
[INFO] [talledLocalContainer] Caused by: java.lang.ClassNotFoundException: com.atlassian.jira.plugin.webfragment.conditions.UserIsAdminCondition not found by com.acme.jira.my-addon [165]
[INFO] [talledLocalContainer] 	at ...

 

What am I missing?

When you generate a new plugin with the atlassian-plugin-sdk the generated stub also doesn't work:

atlas-create-jira-plugin
cd my-plugin
atlas-create-jira-plugin-module  select web-item and add the condition under advanced

 

This example can be found here: https://bitbucket.org/aeffle/jira7test/src/

 

Any ideas?

 

=== 

SOLUTION:

Simply disable the new plugin scanner and stick to the old version. This works fine for me smile

8 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

7 votes
Answer accepted
Maciej Kucharek March 10, 2016

Hi @Alexander von Renteln

I know I'm a bit late for the party, but I've just had a similar issue and was able to resolve it by adding the com.atlassian.jira.plugin.webfragment.conditions package to the <Import-Package> tag in pom.xml. 

My maven-jira-plugin pom section look as follows: 

&lt;plugin&gt;
    &lt;groupId&gt;com.atlassian.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-jira-plugin&lt;/artifactId&gt;
    &lt;version&gt;${amps.version}&lt;/version&gt;
    &lt;extensions&gt;true&lt;/extensions&gt;
    &lt;configuration&gt;
        &lt;productVersion&gt;${jira.version}&lt;/productVersion&gt;
        &lt;productDataVersion&gt;${jira.version}&lt;/productDataVersion&gt;
        &lt;enableQuickReload&gt;true&lt;/enableQuickReload&gt;
        &lt;enableFastdev&gt;false&lt;/enableFastdev&gt;
        &lt;instructions&gt;
            &lt;Atlassian-Plugin-Key&gt;${atlassian.plugin.key}&lt;/Atlassian-Plugin-Key&gt;
            &lt;!-- Add package to export here --&gt;
            &lt;Export-Package&gt;pl.com.tt.mailtask.code, pl.com.tt.mailtask.model.dao,&lt;/Export-Package&gt;
            &lt;!-- Add package import here --&gt;
            &lt;Import-Package&gt;com.atlassian.jira.plugin.webfragment.conditions, org.springframework.osgi.*;resolution:="optional",
                org.eclipse.gemini.blueprint.*;resolution:="optional", *
            &lt;/Import-Package&gt;
            &lt;!-- Ensure plugin is spring powered - see https://extranet.atlassian.com/x/xBS9hQ  --&gt;
            &lt;Spring-Context&gt;*&lt;/Spring-Context&gt;
        &lt;/instructions&gt;
        &lt;pluginArtifacts&gt;
            &lt;pluginArtifact&gt;
                &lt;groupId&gt;com.atlassian.activeobjects&lt;/groupId&gt;
                &lt;artifactId&gt;activeobjects-plugin&lt;/artifactId&gt;
                &lt;version&gt;${ao.version}&lt;/version&gt;
            &lt;/pluginArtifact&gt;
            &lt;pluginArtifact&gt;
                &lt;groupId&gt;com.atlassian.activeobjects&lt;/groupId&gt;
                &lt;artifactId&gt;activeobjects-jira-spi&lt;/artifactId&gt;
                &lt;version&gt;${ao.version}&lt;/version&gt;
            &lt;/pluginArtifact&gt;
        &lt;/pluginArtifacts&gt;
    &lt;/configuration&gt;
&lt;/plugin&gt;

Hope it's going to help you wink

Lila Linux August 14, 2016
With that import-package instruction in pom.xml it finds the webfragment condition, but no unique bean for it's permissionmanager dependency sad
Any idea how to resolve that?
Martin Ma
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 29, 2018

Thanks @Maciej Kucharek, this solution saved my day!

3 votes
Answer accepted
Volodymyr Krupach
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 10, 2015

It should work. At least it works for me under JIRA 7.0.0.

Did you try atlas-clean for your addon?

I see error in the stacktrace that there is no 

com.atlassian.jira.plugin.webfragment.conditions.UserIsAdminCondition class and
UserIsAdminCondition is part of jira-api. Have not you accidentally deleted jira-api dependency from pom.xml?
AlexanderR December 10, 2015

I didn't delete that dependency - actually it doesn't even work for a newly generated plugin. 15 <dependencies> 16 <dependency> 17 <groupId>com.atlassian.jira</groupId> 18 <artifactId>jira-api</artifactId> 19 <version>${jira.version}</version> 20 <scope>provided</scope> 21 </dependency> [...] 155 <properties> 156 <jira.version>7.0.4</jira.version> 157 <amps.version>6.1.2</amps.version> 158 <plugin.testrunner.version>1.2.3</plugin.testrunner.version> 159 <atlassian.spring.scanner.version>1.2.6</atlassian.spring.scanner.version> 160 <!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. --> 161 <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key> 162 <!-- TestKit version 6.x for JIRA 6.x --> 163 <testkit.version>6.3.11</testkit.version> 164 </properties>

Volodymyr Krupach
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 10, 2015

I see you have atlassian.spring.scanner.version and probably atlassian-spring-scanner plugin (I guess it's auto generated in the latest AMPS). Try to clean your pom.xml so it looks like (you may need to bring back test related stuff if you use it):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;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"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;som.group&lt;/groupId&gt;
  &lt;artifactId&gt;art-id&lt;/artifactId&gt;
  &lt;version&gt;0.1&lt;/version&gt;
  &lt;organization&gt;
    &lt;name&gt;NAME&lt;/name&gt;
    &lt;url&gt;http://name.com/&lt;/url&gt;
    
  &lt;/organization&gt;
  &lt;name&gt;NAME&lt;/name&gt;
  &lt;description&gt;DESC&lt;/description&gt;
  &lt;packaging&gt;atlassian-plugin&lt;/packaging&gt;
  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.atlassian.jira&lt;/groupId&gt;
      &lt;artifactId&gt;jira-api&lt;/artifactId&gt;
      &lt;version&gt;${jira.version}&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.atlassian.upm&lt;/groupId&gt;
      &lt;artifactId&gt;licensing-api&lt;/artifactId&gt;
      &lt;version&gt;2.0.1&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.atlassian.upm&lt;/groupId&gt;
      &lt;artifactId&gt;upm-api&lt;/artifactId&gt;
      &lt;version&gt;2.0.1&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;com.atlassian.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-jira-plugin&lt;/artifactId&gt;
        &lt;version&gt;${amps.version}&lt;/version&gt;
        &lt;extensions&gt;true&lt;/extensions&gt;
        &lt;configuration&gt;
          &lt;productVersion&gt;${jira.version}&lt;/productVersion&gt;
          &lt;productDataVersion&gt;${jira.version}&lt;/productDataVersion&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
          &lt;source&gt;1.7&lt;/source&gt;
          &lt;target&gt;1.7&lt;/target&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;properties&gt;
    &lt;jira.version&gt;6.4.12&lt;/jira.version&gt;
    &lt;amps.version&gt;6.1.2&lt;/amps.version&gt; &lt;!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. --&gt;
    &lt;atlassian.plugin.key&gt;${project.groupId}.${project.artifactId}&lt;/atlassian.plugin.key&gt;
    &lt;useFastdevCli&gt;false&lt;/useFastdevCli&gt;
  &lt;/properties&gt;
&lt;/project&gt;
AlexanderR December 11, 2015

Hi, I put an example here: https://bitbucket.org/aeffle/jira7test/src/ Unfortunately, I think one has to use the new plugin system and the new scanner which finds out dependencies at build time.

Volodymyr Krupach
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 11, 2015

pom I posted works for me and it should work for you. There are no wonders and even if smth looks like a wonder there is always explanation when you dig deeper :-).

Volodymyr Krupach
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 11, 2015

You can use the old "atlassian-plugin.xml component style", just clean your pom.xml to look like mine.

AlexanderR December 11, 2015

Hey Volodymyr, thank you very much. I just tried it in my test playground and it actually works :-) So the solution is to simply not use the new style and hope that they fix it before the old version is deprecated :-) Cheers, Alex

Volodymyr Krupach
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 11, 2015

Glad that it works for you :-)

pieterG February 10, 2016

fyi: i reported this as a bug a while ago and it seems they are working on it:

https://ecosystem.atlassian.net/browse/AMPS-1309

5 votes
Andrew S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2017

The reason the condition class is not found is that your plugin's OSGi manifest does not contain an `Import-Package` entry for the package in which the condition is located (namely com.atlassian.jira.plugin.webfragment.conditions).

This in turn is because mentioning a class in the plugin XML (or any non-Java file) is not enough for the BND tool (which AMPS uses to generate the manifest) to detect that you require its package.

This is why adding com.atlassian.jira.plugin.webfragment.conditions to the <Import-Package> instructions in your plugin's POM allows your plugin bundle to load the condition's class at runtime. Having jira-api on your classpath only allows you to resolve the class at compile time (which is not necessary if you're only using it from XML).

None of the above is anything to do with the Spring Scanner, which is solely concerned with OSGi services (not packages).

One of the other answers noted that the condition needs to inject the `GlobalPermissionManager` service, which is correct. This OSGi service will only be available to your plugin if you have declared that you're importing it, either by:

  1. a `component-import` entry in the plugin XML (which still works even if you are using Spring Scanner), or
  2. via an `@ComponentImport` annotation on a field or constructor argument of this type in your plugin's Java code (this is where Spring Scanner comes in, as it sees this annotation and declares a Spring OSGi service proxy from it). If you're already using the `GlobalPermissionManager` in your code for some other reason, this will "just work", i.e. you only need to add the <Import-Package> entry described above for the condition to work.

I hope this clears up any confusion or questions about using this condition.

Victor Cheung November 10, 2017

Hi Andrew, thanks for your explanation.  I finally got my plugin XML condition to work:

<condition class="com.atlassian.jira.plugin.webfragment.conditions.UserIsAdminCondition"/>

But I also had to add this to my plugin servlet class, and inject it as part of the constructor to get it all to work:

@ComponentImport
private final PermissionManager permissionMgr;

My servlet does not need to use the PermissionManager class.  It's only there for the sake of getting the plugin UserIsAdminCondition to work.

Is there a more elegant/cleaner solution? 

(I can't use <component-import> tag in my plugin XML to declare the PermissionManager class because in my POM I'm using the Atlassian-Plugin-Key which forbids it... and as I understand, the whole point of all this is to use the latest Scanner 2.x so that plugins will not require run-time 'transformation' so that they load faster -- albeit at the cost of managing the run-time BND package/class imports ourselves)

Andrew S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 7, 2018

Hi Victor,

Glad you got it working!

I agree it's a little ugly to declare a dependency that you don't actually use, just to get something else to work. What some people do is write a "wiring" class (you can call it whatever you want, maybe `ComponentImports`) and add annotated fields of the required types:

/**
* This class exists solely to cause Spring Scanner to import
* the required OSGi services. It should never be instantiated.
*/
public final class ComponentImports {

@ComponentImport private PermissionManager permissionMgr;

private ComponentImports() {
throw new IllegalStateException("Should never be instantiated");
}
Victor Cheung June 8, 2018

Hi Andrew,

Thanks for your suggestion.  I like it!  I think it's a good compromise to use a dedicated class for this purpose.

Cheers!

1 vote
pieterG December 30, 2015

Could you maybe clarify how to disable this scanner and work the 'old style' (i just started trying to build some plugins and never used 'the old style')? tried to remove all scanner related stuff from the pom and added: <component-import key="CustomFieldValuePersister" interface="com.atlassian.jira.issue.customfields.persistence.CustomFieldValuePersister" /> to the atlassian-plugin.xml in the hope to get that component to inject but that also doesnt work. (Is the 'old way' with injection at all?)

0 votes
Maciej Kucharek August 17, 2016

Hi Lila,

with spring-scanner, you can no longer use <component-import> in your xml file. Instead, you should annotate your PermissionManager with @ComponentImport annotation.

Please check out the spring-scanner readme (https://bitbucket.org/atlassian/atlassian-spring-scanner/src/1.2.x/README.md?at=1.2.x&fileviewer=file-view-default), specifically "Add scanner annotations to your code" section

0 votes
Lila Linux August 14, 2016

Unfortunately component-import isn't allowed for plugins:

 

atlassian-plugin.xml contains a definition of component-import. This is not allowed when Atlassian-Plugin-Key is set.

With an import-package instruction in pom.xml it finds the webfragment condition, but no unique bean for it's permissionmanager dependency sad

0 votes
Titus
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 10, 2015

The condition com.atlassian.jira.plugin.webfragment.conditions.UserLoggedInCondition should work as it implements the interface com.atlassian.plugin.web.Condition.

I would suggest the same as Volodymyr. Check your pom.xml and ensure a refence to jira-api is set:

<dependency>

            <groupId>com.atlassian.jira</groupId>

            <artifactId>jira-api</artifactId>

            <!--<version>${jira.version}</version>-->

            <!--<version>6.4.4</version>-->

            <version>7.0.0-m01b</version>

            <scope>provided</scope>

        </dependency>

 

Beside this in your last Stacktrace an exception is thrown for the condition

com.atlassian.jira.plugin.webfragment.conditions.UserIsAdminCondition

This is enabled also adding the dependency of jira-api in the pom.xml

 

For an overview of all conditions see

https://developer.atlassian.com/static/javadoc/jira/5.0.5/reference/com/atlassian/jira/plugin/webfragment/conditions/package-summary.html

0 votes
AlexanderR December 10, 2015

atlas-version output:

$ atlas-version
ATLAS Version:    6.1.0
ATLAS Home:       /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec
ATLAS Scripts:    /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/bin
ATLAS Maven Home: /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1
AMPS Version:     6.1.2
--------
Executing: /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/bin/mvn --version -gs /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.1", arch: "x86_64", family: "mac"

 

Create a new plugin:

atlas-create-jira-plugin

$ atlas-create-jira-plugin --artifact-id my-addon --group-id com.acme --version 1.0.0-SNAPSHOT --non-interactive
Executing: /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/bin/mvn com.atlassian.maven.plugins:maven-jira-plugin:6.1.2:create -gs /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/conf/settings.xml -DartifactId='my-addon' -DgroupId='com.acme' -Dversion='1.0.0-SNAPSHOT' -DinteractiveMode=false
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-jira-plugin:6.1.2:create (default-cli) @ standalone-pom ---
[INFO] Google Analytics Tracking is enabled to collect AMPS usage statistics.
[INFO] Although no personal information is sent, you may disable tracking by adding &lt;allowGoogleTracking&gt;false&lt;/allowGoogleTracking&gt; to the amps plugin configuration in your pom.xml
[INFO] Sending event to Google Analytics: AMPS:jira - Create Plugin
[INFO] determining latest stable product version...
[INFO] using latest stable product version: 7.0.4
[INFO] determining latest stable data version...
[INFO] using latest stable data version: 7.0.4
Define value for groupId: : com.acme
Define value for artifactId: : my-addon
Define value for version:  1.0.0-SNAPSHOT: :
Define value for package:  com.acme: :
Confirm properties configuration:
groupId: com.acme
artifactId: my-addon
version: 1.0.0-SNAPSHOT
package: com.acme
 Y: :
[INFO] Setting property: classpath.resource.loader.class =&gt; 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on =&gt; 'false'.
[INFO] Setting property: resource.loader =&gt; 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound =&gt; 'false'.
[INFO] Generating project in Batch mode
[INFO] Archetype repository missing. Using the one from [com.atlassian.maven.archetypes:jira-plugin-archetype:5 -&gt; https://maven.atlassian.com/public] found in catalog internal
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 49,column 22] : ${atlassian.spring.scanner.version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 56,column 22] : ${atlassian.spring.scanner.version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 121,column 47] : ${atlassian.plugin.key} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 180,column 31] : ${project.groupId} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 180,column 50] : ${project.artifactId} is not a valid reference.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.392 s
[INFO] Finished at: 2015-12-10T15:40:13+01:00
[INFO] Final Memory: 16M/343M
[INFO] ------------------------------------------------------------------------

 

Enter the directory and create a webitem with atlas-create-jira-plugin-module:

$ cd my-addon/
$ atlas-create-jira-plugin-module
Executing: /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/bin/mvn com.atlassian.maven.plugins:maven-jira-plugin:6.1.2:create-plugin-module -gs /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.acme:my-addon:atlassian-plugin:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 163, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-addon 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-jira-plugin:6.1.2:create-plugin-module (default-cli) @ my-addon ---
Choose Plugin Module:
1:  Component Import
2:  Component
3:  Component Tab Panel
4:  Custom Field
5:  Custom Field Searcher
6:  Downloadable Plugin Resource
7:  Gadget Plugin Module
8:  Issue Tab Panel
9:  Keyboard Shortcut
10: JQL Function
11: Licensing API Support
12: Module Type
13: Project Tab Panel
14: REST Plugin Module
15: RPC Endpoint Plugin
16: Report
17: Search Request View
18: Servlet Context Listener
19: Servlet Context Parameter
20: Servlet Filter
21: Servlet
22: Template Context Item
23: User Format
24: Version Tab Panel
25: Web Item
26: Web Panel
27: Web Panel Renderer
28: Web Resource
29: Web Resource Transformer
30: Web Section
31: Webwork Plugin
32: Workflow Condition
33: Workflow Post Function
34: Workflow Validator
Choose a number (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34): 25
[INFO] Google Analytics Tracking is enabled to collect AMPS usage statistics.
[INFO] Although no personal information is sent, you may disable tracking by adding &lt;allowGoogleTracking&gt;false&lt;/allowGoogleTracking&gt; to the amps plugin configuration in your pom.xml
[INFO] Sending event to Google Analytics: AMPS:jira - Create Plugin Module - jira:Web Item
Enter Plugin Module Name My Web Item: : some-name
Enter Section (e.g. system.admin/globalsettings): system.admin/globalsettings
Enter Link URL (e.g. /secure/CreateIssue!default.jspa): /secure/CreateIssue!default.jspa
Show Advanced Setup? (Y/y/N/n) N: : y
Module Key some--name: :
Module Description The some-name Plugin: :
i18n Name Key some--name.name: :
i18n Description Key some--name.description: :
Weight 1000: :
Link Id some--name-link: :
Enter Label Key some--name.label: :
Enter Label Value some-name: :
Add Label Param? (Y/y/N/n) N: :
Add Icon? (Y/y/N/n) N: :
Add Tooltip? (Y/y/N/n) N: :
Add Resource (Y/y/N/n) N: :
Add Velocity Context Provider (Y/y/N/n) N: :
Add Plugin Module Param? (Y/y/N/n) N: :
Add Conditions? (Y/y/N/n) N: : y
Condition Type (AND/and/OR/or) AND: :
Choose A Condition
1: IsAdminCondition
2: UserIsAdminCondition
3: Custom Condition
Choose a number:  (1/2/3) : : 1
Add Condition Parameter? (Y/y/N/n) N: :
Invert Condition? (Y/y/N/n) N: :
Add Condition? (Y/y/N/n) N: :
[INFO] Adding the following items to the project:
[INFO]   [dependency: org.mockito:mockito-all]
[INFO]   [module: web-item]
[INFO]   i18n strings: 3
Add Another Plugin Module? (Y/y/N/n) N: :
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:32 min
[INFO] Finished at: 2015-12-10T15:45:48+01:00
[INFO] Final Memory: 21M/137M
[INFO] ------------------------------------------------------------------------

 

Let it run and crash with atlas-run:

$ atlas-run
Executing: /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/bin/mvn com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:6.1.2:run -gs /usr/local/Cellar/atlassian-plugin-sdk/6.1.0/libexec/apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.acme:my-addon:atlassian-plugin:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 146, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-addon 1.0.0-SNAPSHOT
[INFO] -
 
[...]
 
[INFO] [talledLocalContainer] java.lang.RuntimeException: Unable to enable web fragment
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor.enabled(AbstractWebFragmentModuleDescriptor.java:133)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.DefaultWebItemModuleDescriptor.enabled(DefaultWebItemModuleDescriptor.java:72)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.DefaultAbstractWebFragmentModuleDescriptor.enabled(DefaultAbstractWebFragmentModuleDescriptor.java:35)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.manager.DefaultPluginManager.notifyModuleEnabled(DefaultPluginManager.java:2168)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.manager.DefaultPluginManager.enableConfiguredPluginModule(DefaultPluginManager.java:1850)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.manager.DefaultPluginManager.enableConfiguredPluginModules(DefaultPluginManager.java:1822)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.manager.DefaultPluginManager.enableDependentPlugins(DefaultPluginManager.java:1268)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.manager.DefaultPluginManager.addPlugins(DefaultPluginManager.java:1221)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.manager.DefaultPluginManager.earlyStartup(DefaultPluginManager.java:513)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.JiraPluginManager.earlyStartup(JiraPluginManager.java:104)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.JiraPluginManager.start(JiraPluginManager.java:94)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.ComponentManager$PluginSystem.start(ComponentManager.java:591)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.ComponentManager.quickStart(ComponentManager.java:180)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.ComponentManager.start(ComponentManager.java:153)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:30)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$473(DefaultJiraLauncher.java:129)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$13/574597525.run(Unknown Source)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:298)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:194)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:120)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$471(DefaultJiraLauncher.java:89)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$1/2067326067.run(Unknown Source)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:87)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:79)
[INFO] [talledLocalContainer] 	... 8 filtered
[INFO] [talledLocalContainer] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[INFO] [talledLocalContainer] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO] [talledLocalContainer] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[INFO] [talledLocalContainer] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[INFO] [talledLocalContainer] 	at java.lang.Thread.run(Thread.java:745)
[INFO] [talledLocalContainer] Caused by: com.atlassian.plugin.PluginParseException: Unable to load the module's display conditions: Could not load 'com.atlassian.jira.plugin.webfragment.conditions.IsAdminCondition' in plugin com.acme.my-addon
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditionImplementation(ConditionElementParser.java:95)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditionImplementation(ConditionElementParser.java:29)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.baseconditions.AbstractConditionElementParser.makeCondition(AbstractConditionElementParser.java:116)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeCondition(ConditionElementParser.java:73)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeCondition(ConditionElementParser.java:29)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditions(ConditionElementParser.java:65)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditions(ConditionElementParser.java:29)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.baseconditions.AbstractConditionElementParser.makeConditions(AbstractConditionElementParser.java:57)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditions(ConditionElementParser.java:57)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditions(ConditionElementParser.java:29)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.baseconditions.AbstractConditionElementParser.makeConditions(AbstractConditionElementParser.java:70)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditions(ConditionElementParser.java:57)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor.makeConditions(AbstractWebFragmentModuleDescriptor.java:72)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor.enabled(AbstractWebFragmentModuleDescriptor.java:128)
[INFO] [talledLocalContainer] 	... 37 more
[INFO] [talledLocalContainer] Caused by: com.atlassian.plugin.web.conditions.ConditionLoadingException: Could not load 'com.atlassian.jira.plugin.webfragment.conditions.IsAdminCondition' in plugin com.acme.my-addon
[INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.JiraWebFragmentHelper.loadCondition(JiraWebFragmentHelper.java:45)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor$1.create(AbstractWebFragmentModuleDescriptor.java:169)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.web.descriptors.ConditionElementParser.makeConditionImplementation(ConditionElementParser.java:86)
[INFO] [talledLocalContainer] 	... 51 more
[INFO] [talledLocalContainer] Caused by: java.lang.ClassNotFoundException: com.atlassian.jira.plugin.webfragment.conditions.IsAdminCondition not found by com.acme.my-addon [17]
[INFO] [talledLocalContainer] 	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
[INFO] [talledLocalContainer] 	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
[INFO] [talledLocalContainer] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[INFO] [talledLocalContainer] 	at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)
[INFO] [talledLocalContainer] 	at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.osgi.util.BundleClassLoaderAccessor.loadClass(BundleClassLoaderAccessor.java:46)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.osgi.factory.OsgiPluginInstalledHelper.loadClass(OsgiPluginInstalledHelper.java:65)
[INFO] [talledLocalContainer] 	at com.atlassian.plugin.osgi.factory.OsgiPlugin.loadClass(OsgiPlugin.java:212)
[INFO] [talledLocalContainer] 	at com.atlassian.jira.plugin.webfragment.JiraWebFragmentHelper.loadCondition(JiraWebFragmentHelper.java:42)
[INFO] [talledLocalContainer] 	... 53 more

 

 

Andreas Ebert
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.
May 9, 2016

Thanks @Maciej Kucharek! That worked for me! 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events