我正在尝试使用项目https://github.com/castor-software/decompilercmp。我从git下载,注意到这是一个maven项目,安装了maven,然后尝试这样做:
mvn install并得到:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for se.kth:decompiler-cmp:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for scala:jardiff:jar should not point at files within the project directory, ${basedir}/lib/jardiff.jar will be unresolvable by dependent projects @ line 34, column 25
[WARNING] 'dependencies.dependency.systemPath' for jd:jd-core:jar should not point at files within the project directory, ${basedir}/lib/jd-core-1.0.0.jar will be unresolvable by dependent projects @ line 42, column 25
[WARNING] 'dependencies.dependency.systemPath' for jadx:jadx-cli:jar should not point at files within the project directory, ${basedir}/lib/jadx-0.9.0/lib/jadx-cli-0.9.0.jar will be unresolvable by dependent projects @ line 50, column 25
[WARNING] 'dependencies.dependency.systemPath' for cli.jd:jd-gui:jar should not point at files within the project directory, ${basedir}/lib/jd-gui-1.4.1.jar will be unresolvable by dependent projects @ line 58, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.jode:jode-decompiler:jar should not point at files within the project directory, ${basedir}/lib/jode-1.1.2-pre1.jar will be unresolvable by dependent projects @ line 65, column 25
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: fr.inria.gforge.spoon:spoon-core:jar -> version 7.3.0 vs 7.5.0 @ line 163, column 21
[WARNING] 'dependencies.dependency.systemPath' for scala:jardiff:jar refers to a non-existing file /Users/shlomiagiv/work/decompilercmp/lib/jardiff.jar @ line 34, column 25
[WARNING] 'dependencies.dependency.systemPath' for jd:jd-core:jar refers to a non-existing file /Users/shlomiagiv/work/decompilercmp/lib/jd-core-1.0.0.jar @ line 42, column 25
[WARNING] 'dependencies.dependency.systemPath' for jadx:jadx-cli:jar refers to a non-existing file /Users/shlomiagiv/work/decompilercmp/lib/jadx-0.9.0/lib/jadx-cli-0.9.0.jar @ line 50, column 25
[WARNING] 'dependencies.dependency.systemPath' for cli.jd:jd-gui:jar refers to a non-existing file /Users/shlomiagiv/work/decompilercmp/lib/jd-gui-1.4.1.jar @ line 58, column 25
[WARNING] 'dependencies.dependency.systemPath' for org.jode:jode-decompiler:jar refers to a non-existing file /Users/shlomiagiv/work/decompilercmp/lib/jode-1.1.2-pre1.jar @ line 65, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] -----------------------< se.kth:decompiler-cmp >------------------------
[INFO] Building decompiler-cmp 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.483 s
[INFO] Finished at: 2020-05-03T08:13:12+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project decompiler-cmp: Could not resolve dependencies for project se.kth:decompiler-cmp:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: scala:jardiff:jar:1.2.0, jd:jd-core:jar:1.0.0, jadx:jadx-cli:jar:0.9.0, cli.jd:jd-gui:jar:1.4.1, org.jode:jode-decompiler:jar:1.2.1-pre1: Could not find artifact scala:jardiff:jar:1.2.0 at specified path /Users/shlomiagiv/work/decompilercmp/lib/jardiff.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR]帮助1
缺少的依赖项是项目试图达到的各种反编译器。我怎样才能得到/指着他们?注意,我使用的是MacOS
jadx的pom.xml条目示例:
<dependency>
<groupId>jadx</groupId>
<artifactId>jadx-cli</artifactId>
<version>0.9.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jadx-0.9.0/lib/jadx-cli-0.9.0.jar</systemPath>
</dependency>发布于 2020-05-03 06:08:27
通常,maven使用远程重传(如maven中心)的概念来查找项目的依赖项,并将它们存储在本地存储库缓存中(默认情况下为~/.m2)。如果需要,可以添加自己的远程存储库。
但是,如果在系统范围中定义了依赖项,这意味着您指示maven jar不在存储库中,而是由您在指定的文件夹(systemPath)中提供它。该方法有效地绕过了maven依赖解决机制,通常不应用于实际项目。相反,我们应该安装一些特殊的产品,比如尼克斯或艺术,艺术,这些产品可以作为远程代理,也可以承载您自己的JAR。
为什么要使用系统范围呢?
通常情况下,如果您有无法发布到远程存储库(您的私人公司的商业构件)的jars,并且没有连接/工件,并且不想安装它(如果您是一个在本地机器上运行东西的开发人员,那么就考虑使用它)。
如果您决定无论如何使用系统作用域,那么您应该自己负责向maven“提供”这些依赖项,因此您可能会自己找到这些工件。一旦知道jars的位置,就可以将它们复制到systemPath中指定的文件夹中,并继续绕过maven的依赖关系解析机制。
另一种(可以说是更好的方法)是完全停止使用系统作用域,一旦找到jars,就使用mvn : install - file命令将文件安装到本地存储库缓存(~/.m2)。您将能够指定组id、工件id、版本,并将此jar存储在正确的位置。然后,您就可以将这个jar引用为一个常规的maven依赖项。
这个链接是为教程演示如何使用这些“第三方”罐子。
https://stackoverflow.com/questions/61569966
复制相似问题