Maven并将JAR添加到系统范围 [英] Maven and adding JARs to system scope

查看:142
本文介绍了Maven并将JAR添加到系统范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Android项目中有一个JAR,我希望将其添加到最终的APK中. 好,我去:

I have a JAR in my Android project and I want it to be added to final APK. Okay, here I go:

    <dependency>
        <groupId>com.loopj.android.http</groupId>
        <artifactId>android-async-http</artifactId>
        <version>1.3.2</version>
        <type>jar</type>
        <scope>system</scope>
        <systemPath>${project.basedir}/libs/android-async-http-1.3.2.jar</systemPath>
    </dependency>

但是当我运行mvn package时,我收到警告:

But when I am running mvn package I am getting a warning:

[WARNING] Some problems were encountered while building the effective model for **apk:1.0
[WARNING] 'dependencies.dependency.systemPath' for com.loopj.android.http:android-async-http:jar should not point at files within the project directory, ${project.basedir}/libs/android-async-http-1.3.2.jar will be unresolvable by dependent projects @ line 36, column 25

在最终的APK中,没有JAR.

And in the final APK there are no JARs.

我该如何解决?

推荐答案

您将需要

You will need to add the jar to your local maven repository. Alternatively (better option) specify the proper repository (if one exists) so it can be automatically downloaded by maven

无论哪种情况,都从依赖项中删除<systemPath>标记

In either case, remove the <systemPath> tag from the dependency

这篇关于Maven并将JAR添加到系统范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆