Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7850975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:03:13+00:00 2026-06-02T19:03:13+00:00

I have many sub modules of php projects which are run using ANT [It

  • 0

I have many sub modules of php projects which are run using ANT [It just copies files and runs SQL].

Now I need to Implement Maven for handling future Unit Testing + [Maven is the Best tool which we anyway need to use in the future.]

I have installed Maven for php in Eclipse. I have made a new project using Maven in the IDE itself. I can run the Project also.
[I am a noob to Maven but good with ANTs]

Now I want to call those submodular ANT’s xml using the Maven project.
There is ANT RUN which does the trick for maven, but I am not able to:

  • figure out how to reference modules’ ANT xml outside the Maven Project.
  • Ant just merely linking the XML would do the job? Or do I need more dependencies?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:03:16+00:00Added an answer on June 2, 2026 at 7:03 pm

    Use the Maven ant runner plugin to invoke the ANT logic, using ANT’s subant task

    Example

    $ tree
    .
    |-- pom.xml
    `-- src
        `-- main
            `-- ant
                |-- module1
                |   `-- build.xml
                `-- module2
                    `-- build.xml
    
    5 directories, 3 files
    

    pom.xml

    <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspotontheweb.demo</groupId>
        <artifactId>demo</artifactId>
        <version>1.0-SNAPSHOT</version>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <configuration>
                                <target>
                                    <property name="src.dir" location="${project.build.directory}/../src"/>
                                    <subant>
                                        <fileset dir="${src.dir}" includes="**/build.xml"/>
                                    </subant>
                                </target>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
    

    ANT is configured to run during the “compile” phase of the Maven build. The ANT logic uses the subant task to run external ANT logic.

    Run example

    $ mvn compile
    ..    
    ..
    [INFO] --- maven-antrun-plugin:1.7:run (default) @ demo ---
    [INFO] Executing tasks
    
    main:
    
    main:
         [echo] module1: hello world
    
    main:
         [echo] module2: hello world
    [INFO] Executed tasks
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.394s
    [INFO] Finished at: Fri Apr 27 20:25:35 IST 2012
    [INFO] Final Memory: 4M/15M
    [INFO] ------------------------------------------------------------------------
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to include many header files, which are in different sub-directories. Is there
I have a website which has so many sub folders in it. I have
I have many small files containing code fragments, pseudo-code algorithms, classes, templates, SQL-samples, etc.,
Running IIS 6 with a main website using .net 4. I have many sub
I have an application with many sub projects, currently I use maven2 to compile
I have many sub pages, there urls like www.domain.com/sub/page1.php www.domain.com/sub/page2.php ... Now when I
I have just started looking into using Modules in Flex and would like to
In a project here, we have an Object ClassTest, which has many sub objects:
We have a sub-project 'commonUtils' that has many generic code-snippets used across the parent
I have many users on my web site (20000-60000 per day), which is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.