我正在尝试将http-client
添加到我的maven项目中,而我还没有设法这样做。
我添加了http-core
,commons-codec
和commons-logging
,但它无效。
这是我得到的错误:
java.lang.IllegalStateException: Can't install feature onos-testingapp/0.0.0: Could not start bundle mvn:org.onosproject/onos-testingapp/1.3.0-SNAPSHOT in feature(s) onos-testingapp-1.3.0-SNAPSHOT: Unresolved constraint in bundle onos-testingapp [175]: Unable to resolve 175.0: missing requirement [175.0] osgi.wiring.package; (osgi.wiring.package=org.apache.http)
这是我的POM文件:
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.9.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Import-Package>*, !javax.json</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
我远非Maven专家,所以问题可能很简单,但是我尝试了许多不成功的事情。如果有人有想法我正在听。