2

I would like to run cmd with args from maven.verify Is it possible to do it?

I'm using maven 3.5.3.

I already tried this:

            <plugin>
               <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <exec executable="cmd.exe" spawn="true">
                                    <arg value="curl"/>
                                    <arg value="arg1"/>
                                    <arg value="arg2"/>
                                    <arg value="arg3"/>
                               </exec>
                            </target>
                        </configuration>
                   </execution>
               </executions>      
            </plugin>

But Nothing happens.

What should I do if it's possible. Thanks in advance !

Tamil Selvan
  • 1,600
  • 1
  • 9
  • 25
pacataque
  • 130
  • 12
  • 2
    check out this question: https://stackoverflow.com/questions/49454672/curl-with-maven-exec-plugin-not-working-because-of-cant-handle-single-and-doub. It looks like it's possible to run curl directly instead of using cmd.exe. – p_efros Jan 03 '22 at 08:27
  • 2
    First question: Why do you need to run curl during a Maven build ? Furthermore Why are you using such an old version of Maven and also old version of maven-antrun-plugin (even it's questionable)... ? – khmarbaise Jan 03 '22 at 08:52
  • Thank you Bobinoux, it looks like what I was looking for, I still have some issues to solve but it seems to behave well. I have to run curl to send my exe to a server for antivirus control. I just didn't take time to update this version but I can if it could help. – pacataque Jan 04 '22 at 08:08

0 Answers0