Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java maven'的变通方法;s";未能解析工件“;在非平凡依赖中_Java_Maven_Dependencies - Fatal编程技术网

Java maven'的变通方法;s";未能解析工件“;在非平凡依赖中

Java maven'的变通方法;s";未能解析工件“;在非平凡依赖中,java,maven,dependencies,Java,Maven,Dependencies,在构建旧项目时,有时我会遇到可怕的无法解决工件的错误 然后我要做的是搜索特定工件的jar和pom,并使用 这解决了一般情况,但有时项目对工件的依赖性并不简单,并包含在项目的pom字段中,例如: <scope>runtime</scope> 运行时 或者更糟: <exclusion> <groupId>cglib</groupId> <artifactId>cglib

在构建旧项目时,有时我会遇到可怕的
无法解决工件的错误

然后我要做的是搜索特定工件的
jar
pom
,并使用

这解决了一般情况,但有时项目对工件的依赖性并不简单,并包含在项目的pom字段中,例如:

      <scope>runtime</scope>
运行时
或者更糟:

      <exclusion>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
      </exclusion>

cglib
cglibnodep

你将如何处理这些案件?是否有办法将这些字段也添加到命令中?

运行时依赖项是Maven将添加到测试类路径中,并包含在程序集或war中,但不包含在编译类路径中的依赖项。如果需要运行测试或包,只需执行完全相同的安装:安装文件(或者,更好的是,运行repo管理器并部署它)。运行时是一个作用域

另一方面,如果您遇到:

<dependency>
   <groupId>abelian</groupId>
   <artifactId>grape</groupId>
   <type>transitive</type>
</dependency>

阿贝尔的
葡萄
及物的
然后,对于install:install文件,您需要使用-dpackage=transitive,对于'classifier'(-dclassizer)也需要使用类似的方法

如果您需要向依赖关系树中添加在其pom中有排除项的内容,那么您需要查找或构造具有该排除项的pom,并将其传递给安装文件目标,该目标具有pom的
-D
。您无法告诉install:install文件在从无到有构建POM时添加排除项