Plugin faild to load when jsoup version updraded in pom.xml

Hi Experts,

When I update my jsoup dependency from 1.13.1 to 1.15.1 then my plugin is getting failed to load.

Kindly advise fixing this issue.

Please find the error and my pom.xml here:

Error:

INFO] [talledLocalContainer]     ___ FAILED PLUGIN REPORT _____________________
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     2 plugins failed to load during Jira startup.
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     	'com.dip.fh.demo' - 'demo for Jira'  failed to load.
[INFO] [talledLocalContainer]     		Cannot start plugin:com.dip.fh.demo
[INFO] [talledLocalContainer]     			Unable to resolve com.dip.fh.demo [190](R 190.0): missing requirement [com.dip.fh.demo [190](R 190.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation.meta) Unresolved requirements: [[com.dip.fh.demo [190](R 190.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation.meta)]
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     		It was loaded from /Users/dipesh/dipesh-
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     	'com.dip.fh.demo-tests' - 'Demo for Jira'  failed to load.
[INFO] [talledLocalContainer]     		Cannot start plugin: com.dip.fh.demo-tests
[INFO] [talledLocalContainer]     			Unable to resolve com.dip.fh.demo-tests [191](R 191.0): missing requirement [com.threadq.fh.field_hide-tests [191](R 191.0)] osgi.wiring.package; (osgi.wiring.package=com.dip.fh.demo.api) [caused by: Unable to resolve com.dip.fh.demo [190](R 190.0): missing requirement [com.dip.fh.demo[190](R 190.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation.meta)] Unresolved requirements: [[ccom.dip.fh.demo-tests [191](R 191.0)] osgi.wiring.package; (osgi.wiring.package=com.dip.fh.demo.api)]
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     		I

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.dip.fh</groupId>
	<artifactId>demo</artifactId>
	<version>3.6</version>
	
	<packaging>atlassian-plugin</packaging>
	<dependencies>
		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-api</artifactId>
			<version>${jira.version}</version>
			<scope>provided</scope>
		</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>

		
		
		
		<!-- 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>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>4.1.6.RELEASE</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>

		<dependency>
			<groupId>com.atlassian.activeobjects</groupId>
			<artifactId>activeobjects-plugin</artifactId>
			<version>1.1.5</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>javax.inject</groupId>
			<artifactId>javax.inject</artifactId>
			<version>1</version>
			<scope>provided</scope>
		</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.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.8.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.1.1</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.plugins.rest</groupId>
			<artifactId>atlassian-rest-common</artifactId>
			<version>1.0.2</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.sal</groupId>
			<artifactId>sal-api</artifactId>
			<version>2.6.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.wink</groupId>
			<artifactId>wink-client</artifactId>
			<version>1.4</version>
			<scope>test</scope>
		</dependency>
		
		<dependency>
			<groupId>com.atlassian.upm</groupId>
			<artifactId>licensing-api</artifactId>
			<version>2.21.4</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.upm</groupId>
			<artifactId>upm-api</artifactId>
			<version>2.21</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.0.1</version>
			<scope>provided</scope>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
		<!--  dependency>
		    <groupId>org.jsoup</groupId>
		    <artifactId>jsoup</artifactId>
		    <version>1.13.1</version>
		    <scope>compile</scope>
		</dependency> -->
		
		<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
		<dependency>
		    <groupId>org.jsoup</groupId>
		    <artifactId>jsoup</artifactId>
		    <version>1.15.1</version>
		    <scope>compile</scope>
		</dependency>
				
	
		
		<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
		<dependency>
		    <groupId>org.projectlombok</groupId>
		    <artifactId>lombok</artifactId>
		    <version>1.18.20</version>
		    <scope>provided</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>
<!--    		    <productDataPath>${basedir}/src/test/resources/generated-test-resources-${jira.version}.zip</productDataPath>   -->
					<systemPropertyVariables>
                        <atlassian.mail.senddisabled>false</atlassian.mail.senddisabled>
                    </systemPropertyVariables>


					<!-- 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>
					<!-- 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>com.dip.fh.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>
			<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
		</plugins>
	</build>
	<properties>
		<jira.version>8.20.8</jira.version>
        <amps.version>8.0.0</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>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven.javadoc.skip>true</maven.javadoc.skip>
	</properties>
</project>

Hi, I am a beginner developer of java plugins. Also faced with this problem. When building the plugin, I saw that the jsoup v 1.8.3 library already exists in the project structure. But the plugin refused to work on the local stand. Then I imported v 1.15.2 and it helped on the local stand. But on the test stand during installation, it showed the error “some modules do not work due to the lack of dependencies”. A few hours later I tried to install another version of jsoup 1.13.1 and it worked.

Hi @dchouksey89,

Thanks for your question. Looking at the error I can see it says

Unable to resolve com.dip.fh.demo [190](R 190.0): missing requirement [com.dip.fh.demo [190](R 190.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation.meta) Unresolved requirements: [[com.dip.fh.demo [190](R 190.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation.meta)]

The issue ins’t jsoup but missing javax.annotation.meta. Looking at the jsop releases I found this fix for Release 1.14.3

Are you using jsr305 annotations without explicitly importing them?

Can you try

<Import-Package>*;resolution:="optional"</Import-Package>

instead?

Regards,
James.

2 Likes