1

我正在尝试添加http-client到我的 Maven 项目中,但我没有设法这样做。

我已经添加了http-corecommons-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 专家,所以问题可能很简单,但是我尝试了很多事情都没有成功。如果有人有想法,我正在听。

4

0 回答 0