我正在使用 maven-ant-run 插件通过 maven 运行 jar 批处理,它很酷,我需要的是能够读取 maven 构建报告中的 system.out.println 字符串。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>clean</phase>
<configuration>
<target>
<echo>
Language synchronization is being started
</echo>
<exec executable="cmd.exe"
spawn="true">
<arg value="/c"/>
<arg value="${languagesynch.path}"/>
<arg value="C:\ContinuousIntegration\res" /> <!--copy from-->
<arg value="${project.basedir}\res" /> <!--to this directory-->
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
它只显示正在执行的任务和已执行的任务。
[INFO] --- maven-antrun-plugin:1.6:run (default) ---
[INFO] Executing tasks
main:
[echo] Language synchronization is being started through D:\Projects\MavenI
nHerd\LanguageSynch\out\artifacts\LanguageSynch_jar\LanguageSynch.jar
[INFO] Executed tasks