java有一种从文本中读取文本的方法。文件,并将其设置为pom中的maven属性。xml专家?
有没有办法从一篇课文中读出一篇课文。文件,并将其设置为pom中的maven属性。xml专家?我正在尝试以下代码。但是,我需要阅读来自tmp的文本。txt并将其分配给maven属性“token”
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>generate-random-string</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>temp.sh</argument>
</arguments>
<workingDirectory>temp.txt</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
临时工。嘘
PWD=${openssl rand hex 12}
echo $PWD >> temp.txt
# 1 楼答案
您可以使用properties maven插件:https://www.mojohaus.org/properties-maven-plugin/
在你的pom里。xml。将生成文件的文件路径放在配置部分