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 379741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:55:16+00:00 2026-05-12T14:55:16+00:00

I have maven configured to run gunit (an ANTLR grammar unit testing tool) through

  • 0

I have maven configured to run gunit (an ANTLR grammar unit testing tool) through the maven-gunit-plugin. gunit, however, has two different modes. The first mode causes gunit to act as an interpreter, reading through the *.gunit (or *.testsuite) file, interpreting it, and displaying the results. It can be configured as such:

  <plugin>
    <groupId>org.antlr</groupId>
    <artifactId>maven-gunit-plugin</artifactId>
    <version>3.1.3</version>
    <executions>
        <execution>
            <id>maven-gunit-plugin</id>
            <phase>test</phase>
            <goals>
                <goal>gunit</goal>
            </goals>
        </execution>
    </executions>
  </plugin>

The second mode causes gunit to generate source code that can be run by JUnit. How can I instruct the maven-gunit-plugin to generate JUnit sources instead of acting as an interpreter?

A few notes:

  • I can change the test phase to “generate-test-sources” to cause the maven plugin to run at the correct time.
  • I couldn’t find any useful documentation on the maven-gunit-plugin
  • I’ve seen people use exec-maven-plugin to run gunit with a specific command line option, but I’m not looking to do that.

EDIT / RESOLUTION:

After reading the various responses, I downloaded the ANTLR source code, which includes the maven-gunit-plugin. The plugin does not support junit generation. It turns out that the codehaus snapshot of the gunit-maven-plugin and the exec plugin are currently the only options.

  • 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-05-12T14:55:16+00:00Added an answer on May 12, 2026 at 2:55 pm

    I found a discussion through MNG-4039 that is illustrated with a maven-gunit-plugin gunit-maven-plugin sample. I’ll let you read the whole article but, according to the author, you should end up with something like this:

    <dependencies>
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr-runtime</artifactId>
        <version>3.1.1</version>
      </dependency>
      <!-- Here is the 'extra' dep -->
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>3.1.1</version>
        <!-- we try to use scope to hide it from transitivity -->
        <scope>test</scope> <!-- or perhaps 'provided' (see later discussion) or 'import' (maven >= 2.0.9) -->
      </dependency>
    </dependencies>
    <build>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>gunit-maven-plugin</artifactId>
          <version>1.0.0-SNAPSHOT</version>
          <executions>
            <execution>
              <goals>
                <goal>generate</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
    

    I didn’t test this configuration myself and can’t thus confirm everything is working out of the box. I don’t even know if the plugin has been released in a non SNAPSHOT version. The only thing I can confirm is that it seems indeed very hard to find “real” documentation about the maven-gunit-plugin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how to run findbugs through eclipse with maven project. I have configured in maven
I have maven-plagin and need to run goal, that should automatically run before plugin.
I have flex application consisting of several modules which is configured using maven. I'm
I'm trying to get Flyway configured and have run up against issue 156 ,
I've got a following problem: I have configured a ant plugin within my pom.xml
I have imported maven project in eclipse and configured properly. Its a web application,
I have a problem with the release plugin for maven. I use maven 2.2
I'm new to Maven. I have a multi-module maven 2 project that has the
I have a Flex/Java web application that uses Maven as a build tool. Currently,
I'm using the maven-jetty-plugin to run a web application in development mode. Also, I

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.