问题
I try to use property with maven-antrun-plugin. But it seems to be blocked in some case (I had the similar problem with exec-maven-plugin :
- It work with sudo mvn package : The script 0_init_livraison.ksh is executed. After this, execution, antrun asked me a question "Souhaitez-vous continuer ?" If the answer is yes, the build can continue. If the answer is no the script send an error message and the build is stopped.
- It don't work with sudo mvn release:prepare : antrun ask the question and the build stay blocked (regardless of my answer)
I need to do a release
Here the concerned part of my pom.xml :
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>initialisation</id>
<phase>initialize</phase>
<configuration>
<tasks>
<exec dir="${project.basedir}"
executable="${project.basedir}/livraison/outils/0_init_livraison.ksh"
failonerror="false"
resultproperty="sortieInitScript">
<arg line="${project.name} ${project.version} ${ancienneVersion}" />
<redirector errorproperty="redirector.err" />
</exec>
<echo message="Resultat ${sortieInitScript}, Message ${redirector.err}"/>
<input message=" Souhaitez-vous Continuer ? "
validargs="o,n"
addproperty="procedureChoix" />
<fail message="ARRET VOLONTAIRE DE LA PROCEDURE !!">
<condition>
<equals arg1="${procedureChoix}" arg2="n" />
</condition>
</fail>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Here the concerned part of my 0_init_livraison.ksh :
...
echo -e "\n| FIN DU SCIPT "
echo -e " ============================================================"
echo "warning" 1>&2
The last lines of my console when i do a sudo mvn package :
[exec] | FIN DU SCIPT
[exec] ============================================================
[exec]
[echo] Resultat 0, Message warning
Souhaitez-vous Continuer ? (o, n)
o
[INFO] Executed tasks (<- this last line doesn't appear with mvn release:prepare. But it appears with mvn package)
...
Do i miss something with release command ?
Thanks for the reading :)
来源:https://stackoverflow.com/questions/31981482/antrun-input-task-doesnt-work-during-mvn-releaseprepare-operation