Guest User

Untitled

a guest
Aug 10th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. How do I execute simple ant call through maven?
  2. C:project<project_name>ant -lib antlib -buildfile applications/<sub-project-path>/ant/build.xml deploy
  3.  
  4. <build>
  5. <plugins>
  6. <plugin>
  7. <groupId>org.codehaus.mojo</groupId>
  8. <artifactId>exec-maven-plugin</artifactId>
  9. <version>1.2.1</version>
  10. <executions>
  11. <execution>
  12. <phase>process-resources</phase>
  13. <goals>
  14. <goal>exec</goal>
  15. </goals>
  16. <configuration>
  17. <executable>ant</executable>
  18. <workingDirectory>${basedir}</workingDirectory>
  19. <arguments>
  20. <argument>'-lib ant/lib'</argument>
  21. <argument>'-buildfile $basedir/<project-path>/build.xml'</argument>
  22. <argument>deploy</argument>
  23. </arguments>
  24. </configuration>
  25. </execution>
  26. </executions>
  27. </plugin>
  28. </plugins>
  29. </build>
  30.  
  31. <plugin>
  32. <groupId>org.codehaus.mojo</groupId>
  33. <artifactId>exec-maven-plugin</artifactId>
  34. <version>1.2.1</version>
  35. <executions>
  36. ...
  37. </executions>
  38. <dependencies>
  39. <dependency>
  40. <groupId>ant-contrib</groupId>
  41. <artifactId>ant-contrib</artifactId>
  42. <version>${ant-contrib.version}</version>
  43. <exclusions>
  44. <exclusion>
  45. <groupId>ant</groupId>
  46. <artifactId>ant</artifactId>
  47. </exclusion>
  48. </exclusions>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.apache.tomcat</groupId>
  52. <artifactId>jasper</artifactId>
  53. <version>${tomcat.compile.version}</version>
  54. </dependency>
  55. <dependency>
  56. <groupId>com.sun</groupId>
  57. <artifactId>tools</artifactId>
  58. <version>${java.version}.0</version>
  59. <scope>system</scope>
  60. <systemPath>${jdk.home}/tools.jar</systemPath>
  61. </dependency>
  62. </dependencies>
  63. </plugin>
  64.  
  65. <plugin>
  66. <groupId>org.apache.maven.plugins</groupId>
  67. <artifactId>maven-antrun-plugin</artifactId>
  68. <version>1.7</version>
  69. <executions>
  70. <execution>
  71. <id>ant</id>
  72. <phase>process-resources</phase>
  73. <configuration>
  74. <target>
  75. <ant antfile="${basedir}/<project-path>/build.xml">
  76. <target name="deploy"/>
  77. </ant>
  78. </target>
  79. </configuration>
  80. <goals>
  81. <goal>run</goal>
  82. </goals>
  83. </execution>
  84. </executions>
  85. </plugin>
Add Comment
Please, Sign In to add comment