2016-06-10 88 views
0

項目主要依賴春天引導和吉拉REST API給Maven中依賴錯誤

<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> 

JIRA REST API的依賴

<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> 

錯誤

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客戶端及其依賴項與Spring-boot-starter-parent,spring-boot-web衝突。有人可以指導我如何解決這些衝突。

回答

3

添加以下道具到你的pom

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

供您參考,我全聚甲醛是這樣的:

<?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> 

+0

Somaiah說Kumbera。我感謝您爲創建github回購所做的努力。當我嘗試時,你的代碼工作完美。但它與我現有的一套春季圖書館有一些衝突。如果可能,你可以告訴我如何在我的現有庫中使用你的庫文件 –

+0

你編輯了問題並改變了情況。如果您有原始問題,將會在未來幫助其他人。對於依賴性問題,您可以創建一個新問題 –

+0

Ya。我沒有想到這一點。對不起 –