Hello everyone,
I have a quick question if any of you have any ideas about it. We do know when we develop a plugin for Atlassian Bamboo, if Bamboo has a remote agent it publishes that plugin to remote agent as well. This being said, it’s also said that remote agents are primitive versions of Atlassian Bamboo thus it doesn’t have all the libraries that Bamboo has. This is where my problem kicked in. If I briefly explain, we have developed a plugin for one of our customers. It’s working pretty well on Bamboo Local machine, however what i discovered yesterday is that the plugin is not working on remote agent (not even getting enabled) because of missing Active Objects artifacts on remote agent. Active Objects libraries are provided by Bamboo Local installation and it works well on Local agent machine. However it doesn’t exist on remote agent. The only library on remote agent is activeobjects-spi plugin. I have 2 questions regarding to this:
- As you can guess how can we solve this missing active objects plugin issue?
- How to deal with artifact (internal library) differences between remote agent and local Bamboo installation. Should I include those libraries in my artifact by manipulating the scope?
Bamboo remote agent log says;
Cannot determine required plugins, cannot resolve bundle 'tr.com.obss.plugin.generic-bamboo-plugin'
2018-12-07 10:04:18,973 ERROR [remoteEventRebroadcasterMessageListenerContainer-1] [OsgiPlugin] Detected an error (BundleException) enabling the plugin 'tr.com.obss.plugin.generic-bamboo-plugin' : Unresolved constraint in bundle tr.com.obss.plugin.generic-bamboo-plugin [48]: Unable to resolve 48.0: missing requirement [48.0] osgi.wiring.package; (osgi.wiring.package=com.atlassian.activeobjects.external). This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN
Plugin-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner/2"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.atlassian.com/schema/atlassian-scanner/2
http://www.atlassian.com/schema/atlassian-scanner/2/atlassian-scanner.xsd">
<atlassian-scanner:scan-indexes />
</beans>
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>tr.com.obss.plugin</groupId>
<artifactId>generic-bamboo-plugin</artifactId>
<version>0.4.18</version>
<organization>
<name>Open Business Software Solutions</name>
<url>http://obss.co/</url>
</organization>
<name>Misc Tools for Atlassian Bamboo</name>
<description>This is a utiliy tool for Atlassian Bamboo developed by OBSS.</description>
<packaging>atlassian-plugin</packaging>
<properties>
<bamboo.version>6.6.2</bamboo.version>
<bamboo.data.version>6.6.2</bamboo.data.version>
<amps.version>6.3.15</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>2.1.7</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml
and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<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>
<dependencies>
<dependency>
<groupId>com.atlassian.bamboo</groupId>
<artifactId>atlassian-bamboo-web</artifactId>
<version>${bamboo.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-annotation</artifactId>
<version>${atlassian.spring.scanner.version}</version>
<scope>provided</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>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</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>
<dependency>
<groupId>com.atlassian.applinks</groupId>
<artifactId>applinks-api</artifactId>
<version>5.0.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.sal</groupId>
<artifactId>sal-api</artifactId>
<version>3.0.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.activeobjects</groupId>
<artifactId>activeobjects-plugin</artifactId>
<version>1.2.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-bamboo-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${bamboo.version}</productVersion>
<productDataVersion>${bamboo.data.version}</productDataVersion>
<enableQuickReload>true</enableQuickReload>
<enableFastdev>true</enableFastdev>
<productDataPath>${basedir}/src/generated-test-resources.zip</productDataPath>
<!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<Import-Package>
*
</Import-Package>
<Spring-Context>*</Spring-Context>
</instructions>
<skipManifestValidation>true</skipManifestValidation>
</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>
<scannedDependencies>
<dependency>
<groupId>com.atlassian.plugin</groupId>
<artifactId>atlassian-spring-scanner-external-jar</artifactId>
</dependency>
</scannedDependencies>
<verbose>false</verbose>
</configuration>
</plugin>
</plugins>
</build>
</project>
Thanks in advance,
Regards,
Korkut.