rpm-maven-plugin中的外部脚本是否可以访问maven属性 [英] does an external script in rpm-maven-plugin have access to maven properties

查看:116
本文介绍了rpm-maven-plugin中的外部脚本是否可以访问maven属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在如下所示的外部postinstallScriptlet中,是否可以访问诸如${project.artifactId}之类的Maven属性? pom.xml文件包含以下代码段:

In an external postinstallScriptlet as follows, is there a way to access maven properties such as ${project.artifactId}? The pom.xml file has this snippet:

<postinstallScriptlet>
    <scriptFile>scripts/postinstall.sh</scriptFile>
    <fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>

推荐答案

不能直接访问属性,但是可以使用

The properties are not directly accessible, but you can use the maven-resources-plugin copy-resources goal to apply filters while copying from your scripts directory into target. Your scriptFile configuration would then need to be changed to point to the copied resource under target.

这篇关于rpm-maven-plugin中的外部脚本是否可以访问maven属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆