我可以使用 Eclipse m2e UPDATE 执行 maven 插件吗?

Can I execute maven plugin whith Eclipse m2e UPDATE?

我有一个 Maven 项目,当我右键单击 -> Maven -> 更新项目时,我想要求 Eclipse 将依赖项 jar 复制到 WEB-INF/lib ...
通过使用以下插件,我可以复制执行 mvn 验证的 jar。但是我想要的是在执行 Maven -> Update Project ... with m2e

时执行这个插件
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>copy</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>com.test.repo</groupId>
                                <artifactId>myDependencyJar</artifactId>
                                <overWrite>true</overWrite>
                                <outputDirectory>${basedir}/WebContent/WEB-INF/lib</outputDirectory>
                            </artifactItem>
                        </artifactItems>
                        <outputDirectory>${basedir}/WebContent/WEB-INF/lib</outputDirectory>
                        <overWriteReleases>false</overWriteReleases>
                        <overWriteSnapshots>true</overWriteSnapshots>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Maven -> Update Project 根本不执行Maven。它只是使用 pom.xml 文件中的数据更新 Eclipse 项目。所以我会说不可能通过这种方式执行 Maven 插件。

更多关于 "Maven -> Update" here