Java Maven依赖项未复制到WEB-INF\lib文件夹

Java Maven依赖项未复制到WEB-INF\lib文件夹,java,maven,Java,Maven,无论我如何mvn clean install,即使使用-U,此依赖项(以及其他一些依赖项)也不会被处理到target\app-1.0-SNAPSHOT\WEB-INF\lib文件夹中: <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-rest-webmvc</artifactId>

无论我如何
mvn clean install
,即使使用
-U
,此依赖项(以及其他一些依赖项)也不会被处理到
target\app-1.0-SNAPSHOT\WEB-INF\lib
文件夹中:

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-rest-webmvc</artifactId>
        <version>2.1.0.RELEASE</version>
    </dependency>

org.springframework.data
spring数据rest webmvc
2.1.0.1发布
不知道为什么现在会发生这种情况,因为在pom.xml中有
war

构建

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.google.appengine</groupId>
                <artifactId>appengine-maven-plugin</artifactId>
                <version>${appengine.version}</version>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- Copies static web files from src/main/webapp to target/${webappDirectory} -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <executions>
                    <execution>
                        <!-- the exploded goal gets executed during compile phase -->
                        <phase>compile</phase>
                        <goals>
                            <goal>exploded</goal>
                            <goal>war</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <warName>${project.artifactId}</warName>
                    <webappDirectory>${webappDirectory}</webappDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

org.springframework.boot
springbootmaven插件
com.google.appengine
appengine maven插件
${appengine.version}
maven依赖插件
安装
复制依赖项
${project.build.directory}/lib
org.apache.maven.plugins
maven战争插件
2.1.1
编写
爆炸了的
战争
错误的
${project.artifactId}
${webappDirectory}

看起来不像,但值得一问:依赖的范围是什么。这没什么,所以我假设这不是“测试”。只是检查一下。第二个问题。您是否有多个“Dependences”部分?当您安装maven时,上面的jar是否会下载到您的本地repo中?只有一个“Dependences”部分,我没有在Dependence中添加scope标记。这个OP中的那个就是pom中的那个。xml@vikeng21是的,它在.m2文件夹中。在pom中尝试此条目为true,然后查看它是否有效