java - 使用 M2Eclipse 插件在交互模式下使用 versions-maven-plugin 设置版本?

标签 java eclipse maven versions-maven-plugin

我想用 versions-maven-plugin 更改我的多模块项目的版本和目标versions:set在 Eclipse 中。我用 M2Eclipse .

我可以在启动配置中使用 -DnewVersion=0.0.2-SNAPTSHOT 设置新版本,它工作正常。但是我想使用交互模式。

如果我没有在启动配置中设置 -DnewVersion=0.0.2-SNAPTSHOT,我会收到以下错误消息:

[ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.2:set (default-cli) on project test-parent: You must specify the new version, either by using the newVersion property (that is -DnewVersion=... on the command line) or run in interactive mode -> [Help 1]

Maven Settings Reference说:

  • interactiveMode: true if Maven should attempt to interact with the user for input, false if not. Defaults to true.

最佳答案

我找到了解决方法,请参阅 How to make Eclipse prompt me for command line arguments .

我必须这样定义系统属性

-DnewVersion=${string_prompt:new version}

在 Eclipse 中启动启动配置后,我会看到一个输入新版本的对话框。然后 versions-maven-plugin 使用对话框中的版本。

关于java - 使用 M2Eclipse 插件在交互模式下使用 versions-maven-plugin 设置版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34023334/

相关文章:

java - 无法解析 com.fasterxml.jackson.core.JsonGenerator 类型。它是从所需的 .class 文件间接引用的

java - Context.xml 在 mvn clean install 上不会进入 WAR

java - 应用程序无法连接到简单服务器

java - @Rule 声明会导致调试尝试出错

java - GCP - GoogleCredential 与 GoogleCredentials

java - Eclipse 只在本地存储库中查找 jar

maven - Bamboo - jmeter 聚合性能

maven - 为什么 netlib-java 原生 blas/lapack 库没有提高性能?

java - android 调用公共(public)方法并获得成功反馈

java - Android SMS Intent 被同一主体和同一接收者卡住