Bash exec maven插件等效/替代
在Maven中,我们可以使用Bash exec maven插件等效/替代,bash,maven,exec-maven-plugin,Bash,Maven,Exec Maven Plugin,在Maven中,我们可以使用execMaven插件在构建中执行bash命令 中央存储库的哪个插件可以执行相同的任务 我这样问是因为我必须在另一个插件之后执行bash命令,而这个插件只需要在execmaven插件之后在同一阶段执行,所以我不能直接在execmaven插件内部执行 我希望在Maven构建中执行的bash命令如下: cat file1 >> file2 提前感谢。我通过maven antrun插件和任务解决了我的问题: <plugin> <g
execMaven插件
在构建中执行bash命令
中央存储库的哪个插件可以执行相同的任务
我这样问是因为我必须在另一个插件之后执行bash命令,而这个插件只需要在execmaven插件之后在同一阶段执行,所以我不能直接在execmaven插件内部执行
我希望在Maven构建中执行的bash命令如下:
cat file1 >> file2
提前感谢。我通过
maven antrun插件
和
任务解决了我的问题:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>final step</id>
<phase>install</phase>
<configuration>
<target>
<concat destfile="${project.build.directory}/${project.artifactId}-${project.version}.sh" binary="yes">
<fileset file="${project.build.directory}/script/self-installer.sh" />
<fileset file="${project.build.directory}/${project.artifactId}-${project.version}.tar.gz" />
</concat>
<chmod file="${project.build.directory}/${project.artifactId}-${project.version}.sh" perm="+x"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
org.apache.maven.plugins
maven antrun插件
1.8
最后一步
安装
跑
这相当于bash cat命令
请记住,如果要连接二进制文件,则必须设置binary=“yes”
,否则Ant任务将损坏最终文件
无论如何,这仍然不是一个基于bash的解决方案,它只是一个使用Ant例程的技巧,所以它不是真正的等价物,我建议编写一个更容易和更干净的插件,集成到构建过程中。。。