다른 개미 스크립트에서 매개 변수 (-logger org.apache.tools.ant.listener.maillogger)로 다른 Ant 대상을 어떻게 호출합니까?
-
14-11-2019 - |
문제
여러 개의 프로젝트의 Ant 스크립트를 일정한 순서로 시작하는 데 사용되는 기본 개미 스크립트가 있습니다.
각 하위 프로젝트에 대해서는 빌드가 성공했는지 여부를 알리는 이메일을 보내고 싶습니다.
Flag -logger를 org.apache.tools.ant.listener.MailLogger
로 사용할 수 있으므로 빌드가 완료된 후 전자 메일을 보냅니다.
그러나 전자 메일을 보내려는 스크립트를 여러 스크립트로 보내는 경우 해당 플래그를 Ant Call으로 전달하는 방법을 모르겠습니다.
정확하게, 나는 로거 플래그를이 개미 통화로 전달하고 싶습니다 :
-logger org.apache.tools.ant.listener.MailLogger
및param
를 사용하여 성공하지 못했습니다.
해결책
Good question. Personally I could not make it work with the ant
target. It seems flags are not supported.
However, this hack works.
<exec executable="ant.bat">
<arg value="-logger"/>
<arg value="org.apache.tools.ant.listener.MailLogger"/>
<arg value="-f"/>
<arg value="other_build.xml"/>
</exec>
Two immediate issues with this approach:
- Not platform independent.
- Build reports success when sub-build fails (even with exec's
failonerror='true'
)
제휴하지 않습니다 StackOverflow