问题描述
我需要预处理Java Maven项目中的某些资源文件(* .xsl)。
我发现exec-maven-plugin
能够执行Shell命令,并认为我可以分两个步骤完成操作:
但是,我尝试执行的find
命令没有任何输出。 POM中的插件配置如下:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>inline-xml-entities</id>
<phase>generate-resources</phase>
<configuration>
<executable>find</executable>
<useMavenLogger>true</useMavenLogger>
<outputFile>xsl-files.txt</outputFile>
<arguments>
<argument>./src/main/webapp/static/com/atomgraph/</argument>
<argument>-type</argument>
<argument>f</argument>
<argument>-name</argument>
<argument>'*.xsl'</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
我在mvn clean install -X
日志中看到命令已执行:
[DEBUG] Executing command line: [find,./src/main/webapp/static/com/atomgraph/,-type,f,-name,'*.xsl']
xsl-files.txt
文件已创建,但为空:/
如果我转到基于项目的目录并手动执行find ./src/main/webapp/static/com/atomgraph/ -type f -name '*.xsl'
,则会得到预期的.xsl文件列表:
./src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/acl/imports/acl.xsl
./src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/acl/layout.xsl
./src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/admin/layout.xsl
...
我想念什么?
解决方法
这似乎有效:
https://server.com/api/plate-number/{{plate_value}}/assistance