我将会翻译以下内容:
作为一个例子,我有来自不同的Spring模块的5个依赖项,但是在包中我只看到一个。
我的所有依赖项都具有“compile”范围。
为什么会发生这种情况?
敬礼。
我正在为Java Web应用程序创建一个WAR。问题是,在WAR包中,在/WEB-INF/lib目录下只包含了少数的JAR文件。
这是我的 POM.xml 文件:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--
*****THIS IS AN AUTOGENERATED POM; PLEASE DO NOT MODIFY OR COMMIT ANY CHANGES*****
-->
<parent>
...
</parent>
...
<scm>
...
</scm>
<packaging>war</packaging>
<dependencies>
<dependency>
...
</dependency>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javancss.fail>false</javancss.fail>
<checkstyle.fail>false</checkstyle.fail>
<cobertura.fail>true</cobertura.fail>
<pmd.fail>true</pmd.fail>
<findbugs.fail>false</findbugs.fail>
</properties>
</project>
作为一个例子,我有来自不同的Spring模块的5个依赖项,但是在包中我只看到一个。
我的所有依赖项都具有“compile”范围。
为什么会发生这种情况?
敬礼。
maven-war-plugin
部分中添加了一个packagingExcludes
标签。 - azurefrogmvn help:effective-pom
吗? - jmjprovided - 这与 compile 类似,但表示您期望 JDK 或容器在运行时提供它。它仅在编译和测试类路径上可用,并且不是传递性的。
- azurefrog