java - 通过命令行替换 pom.xml 中的 Maven 属性

标签 java maven command-line properties pom.xml

我想通过一些 Maven 插件用命令行调用替换 pom.xml 文件中的 Maven 属性。

<properties>
    <my.property>ISO-8859-1</my.property>
<properties>

你知道有能够做到这一点的插件吗?

versions plugin需要很长时间,因为它检查某些依赖项是否可用。除此之外,它在我的情况下不起作用。

最佳答案

你需要做的就是在命令行运行maven时添加如下内容

-Dmy.property=propertyValue

关于java - 通过命令行替换 pom.xml 中的 Maven 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33130388/

相关文章:

java - 休息服务抛出异常 : Best way to handle

使用 TestNG、JSFUnit 2 和 Arquillian 进行自动化测试的 Maven

python - 如何在 python 中输入密码并为用户的每个字符打印一个星号?

shell - 跨 session 永久清除 fish shell 历史记录

java - ConcurrentHashMap 的计算、computeIfAbsent 和computeIfPresent 方法是完全原子的吗?

java - 如何从非 Activity 类实例化 Activity 类的对象?

java.lang.NoSuchMethodError : org. apache.hadoop.tracing.TraceUtils.wrapHadoopConf 错误

java - 使用 maven-plugin-testing-harness 进行艰难的 mojo 测试

Eclipse - 转换为 Maven 项目

c++ - 在程序选项中添加键值对