66638

Spring boot and Jira REST API give dependency errors in maven

Question:

<strong>project main dependencies</strong>

<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.2.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-cassandra</artifactId> <version>1.1.2.RELEASE</version><!--$NO-MVN-MAN-VER$--> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.3</version> </dependency> <dependency> <groupId>com.rallydev.rest</groupId> <artifactId>rally-rest-api</artifactId> <version>2.1.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.2</version><!--$NO-MVN-MAN-VER$--> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.7</version> </dependency> </dependencies>

<strong>JIRA REST API dependencies</strong>

<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId> <version>1.5</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> <version>1.9</version> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-rest-java-client-api</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-rest-java-client-core</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>14.0-rc1</version> </dependency> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.6.4</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> </dependencies>

<strong>error</strong>

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/nio/NHttpMessageParserFactory at org.apache.http.impl.nio.conn.PoolingClientAsyncConnectionManager.createClientAsyncConnectionFactory(PoolingClientAsyncConnectionManager.java:96)

JIRA Rest api client and its dependencies conflicting with Spring-boot-starter-parent, spring-boot-web. Can somebody guide me how to resolve these conflicts.

Answer1:

Add the following props to your pom

<properties> <httpasyncclient.version>4.0-beta3-atlassian-1</httpasyncclient.version> <httpclient.version>4.2.1-atlassian-2</httpclient.version> </properties>

For your reference, my full pom looks like this:

<?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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.company</groupId> <artifactId>junk</artifactId> <version>1.0-SNAPSHOT</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.5.RELEASE</version> </parent> <properties> <httpasyncclient.version>4.0-beta3-atlassian-1</httpasyncclient.version> <httpclient.version>4.2.1-atlassian-2</httpclient.version> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId> <version>1.5</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-client</artifactId> <version>1.9</version> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-rest-java-client-api</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-rest-java-client-core</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>14.0-rc1</version> </dependency> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.6.4</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-cassandra</artifactId> <version>1.1.2.RELEASE</version><!--$NO-MVN-MAN-VER$--> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.3</version> </dependency> <dependency> <groupId>com.rallydev.rest</groupId> <artifactId>rally-rest-api</artifactId> <version>2.1.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.2</version><!--$NO-MVN-MAN-VER$--> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.7</version> </dependency> </dependencies> <repositories> <repository> <id>atlassian-public</id> <url>https://m2proxy.atlassian.com/repository/public</url> <snapshots> <enabled>true</enabled> <updatePolicy>daily</updatePolicy> <checksumPolicy>warn</checksumPolicy> </snapshots> <releases> <enabled>true</enabled> <checksumPolicy>warn</checksumPolicy> </releases> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>atlassian-public</id> <url>https://m2proxy.atlassian.com/repository/public</url> <releases> <enabled>true</enabled> <checksumPolicy>warn</checksumPolicy> </releases> <snapshots> <checksumPolicy>warn</checksumPolicy> </snapshots> </pluginRepository> </pluginRepositories>

Recommend

  • Jenkins and SSL certificates
  • Getting a blank file when accessing JIRA on SSL
  • Java Arabic (Hirji) Calendar
  • AS2 .swf loadmovie() and unloadmovie() fail when nested inside an AS3 .swf container
  • Log4j2 java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/type/TypeReference
  • how to implement a logger factory for jboss EAP 6.2 applications
  • Gradle compile dependencies not included in Jar
  • Use MongoDB array as stack
  • Apache Flink Dynamically setting JVM_OPT env.java.opts
  • Android: Time calculations, how to add a specified amount of minutes
  • How to make Java compiler generate line numbers in compiled code
  • Hibernate Joda DateTime Sorting
  • NHibernate proxyexception
  • Cannot find “Grammar.txt” in python-sphinx
  • Xamarin MonoAndroid Azure mobile service InsertAsync
  • pip in virtualenv gets ConnectTimeoutError
  • During installation of Django, why do I keep getting ImportError: No module named django?
  • Looking for good analogy/examples for monitor verses semaphore
  • Sending HTML Form Data to Spring REST Web Service
  • Angular2 component view does not update on value change via method
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Authentication in Play! and RestEasy
  • CakePHP ACL tutorial initDB function warnings
  • gspread or such: help me get cell coordinates (not value)
  • jQuery ready not fired after rails link_to is clicked
  • Installing iPhone App to iPhone
  • How to attach a node.js readable stream to a Sendgrid email?
  • Bad request using file_get_contents for PUT request in PHP
  • Could not find rake using whenever rails
  • Cannot resolve symbol 'MyApi'
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Hazelcast - OperationTimeoutException
  • RestKit - RKRequestDelegate does not exist
  • SetUp method failed while running tests from teamcity
  • Matrix multiplication with MKL
  • Revoking OAuth Access Token Results in 404 Not Found
  • Understanding cpu registers
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]