maven - 在 IntelliJ 运行配置中指定 maven 插件执行 ID
问题描述
所以我在我的 pom 中定义了这个插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<!-- Executed when building for deployment. Shade plugin relocated lib classes to avoid multi-plugin conflicts. -->
<execution>
<id>deployment</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
...
</relocation>
</relocations>
<finalName>${project.name}-${project.version}</finalName>
<outputDirectory>deployment</outputDirectory>
</configuration>
</execution>
<!-- Executed when building for testing. Shade plugin does not relocate to enable HotSwapping. -->
<execution>
<id>testing</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<finalName>${project.name}-${project.version}</finalName>
<outputDirectory>test</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
有两种不同的执行方式——一种用于部署,一种用于测试。
如何在 IntelliJ 中创建运行配置,允许我指定要运行的执行。该对话框在任何地方都没有提供该字段,我无法弄清楚如何在 VM 选项字段中执行此操作,因为我不知道如何从命令行设置该参数(如果这甚至是正确的方法) .
我想避免在 pom 中使用配置文件,因为 pom 很长,唯一的区别是这个插件中的重定位步骤。使用配置文件我会有很多不必要的重复......
有任何想法吗?
解决方案
推荐阅读
- node.js - 如何处理 redis-node 中的数据库索引超出范围错误?
- google-cloud-platform - 如何限制从外部 GCP 访问 API Gateway?
- google-cloud-build - Cloudbuild - 使用来自不同步骤的自定义变量构建 docker 映像
- symfony - 无法序列化 Symfony\Component\Cache\Adapter\AbstractAdapter
- python - 在无服务器函数中重用 Python 请求会话 - 何时/如何关闭此会话?
- libreoffice - Unoconv odt 到 pdf 的转换
- javascript - 在未安装节点的情况下使用 Husky(在 Docker 中使用)
- angular - NullInjectorError:没有 HttpClient 的提供者,即使在 http 客户端被注入时也会抛出错误
- python - 如何创建指向特定目录中文件的链接?
- json - 使用 react native fetch json url 获取 TypeError 网络请求失败