donne un projet Maven généré par:Comment utiliser GUNIT avec MAVEN?
mvn archetype:generate -B -DarchetypeGroupId=org.antlr \
-DarchetypeArtifactId=antlr3-maven-archetype \
-DarchetypeVersion=3.2 \
-DgroupId=com.yourcompany \
-DartifactId=yourproject \
-Dversion=yourversion \
-Dpackage=com.yourcompany.package.path
cf: http://www.antlr.org/wiki/display/ANTLR3/Building+ANTLR+Projects+with+Maven
qui ont une telle architecture:
.
|-- pom.xml
`-- src
`-- main
|-- antlr3
| |-- com
| | `-- yourcompany
| | `-- package
| | `-- path
| | |-- TLexer.g
| | |-- TParser.g
| | `-- TTree.g
| `-- imports
| `-- Ruleb.g
`-- java
`-- com
`-- yourcompany
`-- package
`-- path
|-- AbstractTLexer.java
|-- AbstractTParser.java
`-- Main.java
en ajoutant maven-gunit-plugin à la pom:
<plugin>
<groupId>org.antlr</groupId>
<artifactId>maven-gunit-plugin</artifactId>
<version>3.2</version>
<executions>
<execution>
<id>maven-gunit-plugin</id>
<phase>test</phase>
<goals>
<goal>gunit</goal>
</goals>
</execution>
</executions>
</plugin>
Où devraient être les fichiers GUNIT?
mise à jour (déjà):
Je ne parle pas de l'intégration Junit (mais, si elle est la seule façon, je vais vous aller pour celui-ci).
Vous n'avez pas lu les documents? (http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Maven+Integration) – khmarbaise
Je l'ai fait (même celui-ci). Ce n'est pas pour maven-gunit-plugin, et vous pouvez probablement obtenir un meilleur résultat avec org.codehaus.mojo: gunit-maven-plugin comme pour l'intégration de junit. – jwinandy