Help needed for Jira 10 maven POM.xml dependency update using BOM

I am trying to follow the instructions at https://developer.atlassian.com/server/jira/platform/preparing-for-jsw-10-jsm-6/#centralized-dependency-management and change to

<dependency>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-api-bom</artifactId>
    <version>${jira.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

But maven is complaining, that it does not know “import”.

[WARNING] 'dependencies.dependency.scope' for com.atlassian.jira:jira-api-bom:pom must be one of [provided, compile, runtime, test, system] but is 'import'. @ line 23, column 14

Also for other dependencies scope provided should be used, omitting version specifications.

But also here maven is complaining and reminds me to add version number.

This is my current dependency block in pom.xml.

<dependencies>
		<dependency>
		    <groupId>com.atlassian.jira</groupId>
		    <artifactId>jira-api-bom</artifactId>
		    <version>${jira.version}</version>
		    <type>pom</type>
		    <scope>import</scope>
		</dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.1</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>com.atlassian.upm</groupId>
            <artifactId>licensing-api</artifactId>
            <version>${upm.license.compatibility.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.upm</groupId>
            <artifactId>upm-api</artifactId>
            <version>${upm.license.compatibility.version}</version>
            <scope>provided</scope>
        </dependency>
 </dependencies>

Does somebody understanding the update of dependencies im pom.xml described in the release notes of Jira 10?

Best regards, Holger

I think you’ve got to put the import dependency into the <dependencyManagement> section of your pom. Something like this:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api-bom</artifactId>
            <version>${jira.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
</dependencyManagement>

Thank you! Okay, now maven doesn’t complain. But now atlas-run fails with compile errors because certain libraries seems not to be found e.g. javax.ws.rs.

Where and how do I now need to add e.g.?

	        <dependency>
	            <groupId>javax.ws.rs</groupId>
	            <artifactId>jsr311-api</artifactId>
	            <scope>provided</scope>
	        </dependency>
	        <dependency>
	            <groupId>javax.xml.bind</groupId>
	            <artifactId>jaxb-api</artifactId>
	            <scope>provided</scope>
	        </dependency>

Also under dependencyManagement? This seems not to work that simply.

Have a look at the jsr311 mentions at https://bitbucket.org/atlassian/atlassian-rest/src/8.0.x/UPGRADE_720.md.

Replace those dependencies with Jakarta dependencies.

It looks like Maven doesn’t recognize the import scope for dependencies. To resolve this, you should place the import dependency inside the dependencyManagement section of your pom.xml. Here’s how you can update your pom.xml:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api-bom</artifactId>
            <version>${jira.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

For the other dependencies, you can keep the provided scope but you might still need to specify the version numbers to avoid Maven warnings. Here’s an updated example:

<dependencies>
    <dependency>
        <groupId>com.atlassian.jira</groupId>
        <artifactId>jira-core</artifactId>
        <version>10.0.0</version> <!-- Specify the version number -->
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>
    <!-- Add other dependencies similarly -->
</dependencies>

Forthermore with the Jira 10.x comes Java17.
Java 17 has moved many javax packages to jakarta as part of the transition to Jakarta EE2.

Make sure to replace all javax dependencies with their jakarta counterparts. This should help resolve the compatibility issues you’re facing.

You do not have any version inside your definition. You have to declare a version of the package you want to use:

<dependency>
    <groupId>jakarta.ws.rs</groupId>
    <artifactId>jakarta.ws.rs-api</artifactId>
    <version>3.0.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>3.0.0</version>
    <scope>provided</scope>
</dependency>

After you add a version the dependencies the compile process should work.

Best regards
Daniel

I got my pom.xml working fine using the following

    <dependencies>
        <dependency>
		    <groupId>com.atlassian.plugins.rest</groupId>
		    <artifactId>atlassian-rest-v2-api</artifactId>
		    <scope>provided</scope>
		</dependency>
		<dependency>
		    <groupId>jakarta.inject</groupId>
		    <artifactId>jakarta.inject-api</artifactId>
		    <scope>provided</scope>
		</dependency>			
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>		
		<dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <scope>provided</scope>
        </dependency>
  	</dependencies>
    <dependencyManagement>
	    <dependencies>
  			<dependency>
			    <groupId>com.atlassian.jira</groupId>
			    <artifactId>jira-api-bom</artifactId>
			    <version>${jira.version}</version>
			    <type>pom</type>
			    <scope>import</scope>
			</dependency>
	    </dependencies>
	</dependencyManagement>