you can run mvn in ant as a java task suggested attributes:: spawn=false fork=false output=SomeOutputFIle error=SomeErrorFile be sure all the necessary maven jars are on classpath before invoking
BTW: this is the command line you want to emulate in your Java task..you'll need to supply all the env variables %MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS% i assume you're using the same JVM for ANT and maven? http://www.jajakarta.org/ant/ant-1.6.1/docs/en/manual/CoreTasks/java.html Martin Gainty ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Wed, 2 Feb 2011 14:45:05 -0800 > From: [email protected] > To: [email protected] > Subject: getting maven failure code in ant > > > I am currently invoking mvn from ant. However, when there is a BUILD FAILURE > inside mvn, the ant script is still showing that the build is successful. > > How could I determine what the error code is from mvn and read it into ant? > Any ideas? > -- > View this message in context: > http://maven.40175.n5.nabble.com/getting-maven-failure-code-in-ant-tp3368588p3368588.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
