aboutsummaryrefslogtreecommitdiff
path: root/gunit-maven-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'gunit-maven-plugin')
-rw-r--r--gunit-maven-plugin/pom.xml103
-rw-r--r--gunit-maven-plugin/src/main/java/org/antlr/mojo/antlr3/GUnitExecuteMojo.java46
2 files changed, 87 insertions, 62 deletions
diff --git a/gunit-maven-plugin/pom.xml b/gunit-maven-plugin/pom.xml
index 1a50e34..ce43fb1 100644
--- a/gunit-maven-plugin/pom.xml
+++ b/gunit-maven-plugin/pom.xml
@@ -32,34 +32,20 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
<modelVersion>4.0.0</modelVersion>
-
- <prerequisites>
- <maven>2.0</maven>
- </prerequisites>
-
- <groupId>org.antlr</groupId>
- <artifactId>maven-gunit-plugin</artifactId>
- <packaging>maven-plugin</packaging>
-
- <name>ANTLR 3 gUnit Maven plugin</name>
- <description>A Maven plugin for incorporating gUnit testing of grammars</description>
- <url>http://antlr.org</url>
-
- <!--
-
- Inherit from the ANTLR master pom, which tells us what
- version we are and allows us to inherit dependencies
- and so on.
- -->
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr-master</artifactId>
- <version>3.5.2</version>
+ <version>3.5.3</version>
</parent>
+ <artifactId>maven-gunit-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>ANTLR 3 gUnit Maven plugin</name>
+ <description>A Maven plugin for incorporating gUnit testing of grammars</description>
+ <url>http://antlr.org</url>
<properties>
+ <mavenVersion>3.8.4</mavenVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@@ -75,25 +61,68 @@
<!--
The things we need to build the target language recognizer
-->
+ <!-- The things we need to build the target language recognizer -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
- <version>2.0</version>
- <scope>compile</scope>
+ <version>3.8.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-compiler-api</artifactId>
+ <version>2.9.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-build-api</artifactId>
+ <version>0.0.7</version>
+ </dependency>
+ <!-- The version of ANTLR tool that this version of the plugin controls.
+ We have decided that this should be in lockstep with ANTLR itself, other
+ than -1 -2 -3 etc patch releases. -->
+ <!-- Testing requirements... -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.6.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.takari.maven.plugins</groupId>
+ <artifactId>takari-plugin-testing</artifactId>
+ <version>3.0.0</version>
+ <scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0</version>
+ <artifactId>maven-core</artifactId>
+ <version>3.8.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>3.8.4</version>
+ <scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-api</artifactId>
- <version>2.0</version>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.4.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.32</version>
</dependency>
-
<!--
The version of ANTLR tool that this version of the plugin controls.
We have decided that this should be in lockstep with ANTLR itself, other
@@ -104,10 +133,6 @@
<artifactId>antlr</artifactId>
<version>${project.version}</version>
</dependency>
-
- <!--
- Dependency on the gUnit artifact.
- -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>gunit</artifactId>
@@ -120,12 +145,20 @@
<version>1.1</version>
<scope>test</scope>
</dependency>
-
</dependencies>
<build>
<plugins>
+ <plugin> <!-- create javadoc jar -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.3.1</version>
+ <configuration>
+ <javadocVersion>1.8</javadocVersion>
+ <failOnError>false</failOnError>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/gunit-maven-plugin/src/main/java/org/antlr/mojo/antlr3/GUnitExecuteMojo.java b/gunit-maven-plugin/src/main/java/org/antlr/mojo/antlr3/GUnitExecuteMojo.java
index a7e2317..4f2ba87 100644
--- a/gunit-maven-plugin/src/main/java/org/antlr/mojo/antlr3/GUnitExecuteMojo.java
+++ b/gunit-maven-plugin/src/main/java/org/antlr/mojo/antlr3/GUnitExecuteMojo.java
@@ -36,18 +36,22 @@ import org.antlr.gunit.GrammarInfo;
import org.antlr.gunit.gUnitExecutor;
import org.antlr.gunit.AbstractTest;
import org.antlr.gunit.Interp;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
/**
* Takes gUnit scripts and directly performs testing.
- *
- * @goal gunit
- *
- * @phase test
- * @requiresDependencyResolution test
- * @requiresProject true
- *
* @author Steve Ebersole
*/
+@Mojo(
+ name = "gunit",
+ defaultPhase = LifecyclePhase.TEST,
+ requiresDependencyResolution = ResolutionScope.TEST,
+ requiresProject = true)
public class GUnitExecuteMojo extends AbstractMojo {
public static final String ANTLR_GROUP_ID = "org.antlr";
public static final String ANTLR_ARTIFACT_NAME = "antlr";
@@ -55,60 +59,48 @@ public class GUnitExecuteMojo extends AbstractMojo {
/**
* INTERNAL : The Maven Project to which we are attached
- *
- * @parameter expression="${project}"
- * @required
*/
+ @Parameter(defaultValue = "${project}", required = true)
private MavenProject project;
/**
* INTERNAL : The artifacts associated to the dependencies defined as part
* of our configuration within the project to which we are being attached.
- *
- * @parameter expression="${plugin.artifacts}"
- * @required
- * @readonly
*/
+ @Parameter(defaultValue = "${plugin.artifacts}", required = true, readonly = true)
private List<Artifact> pluginArtifacts;
/**
* Specifies the directory containing the gUnit testing files.
- *
- * @parameter expression="${basedir}/src/test/gunit"
- * @required
*/
+ @Parameter(defaultValue = "${basedir}/src/test/gunit", required = true)
private File sourceDirectory;
/**
* A set of patterns for matching files from the sourceDirectory that
* should be included as gUnit source files.
- *
- * @parameter
*/
+ @Parameter
private Set<String> includes;
/**
* A set of exclude patterns.
- *
- * @parameter
*/
+ @Parameter
private Set<String> excludes;
/**
* Specifies directory to which gUnit reports should get written.
- *
- * @parameter expression="${basedir}/target/gunit-report"
- * @required
*/
- private File reportDirectory;
+ @Parameter(defaultValue = "${basedir}/target/gunit-report", required = true)
+ private File reportDirectory;
/**
* Should gUnit functionality be completely by-passed?
* <p>
* By default we skip gUnit tests if the user requested that all testing be skipped using 'maven.test.skip'</p>
- *
- * @parameter expression="${maven.test.skip}"
*/
+ @Parameter(defaultValue = "${maven.test.skip}")
private boolean skip;
public Set<String> getIncludePatterns() {