2016-06-10 76 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。我没有想到这一点。对不起 –