net.orfjackal.retrolambda.maven
Class ProcessTestClassesMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by net.orfjackal.retrolambda.maven.ProcessTestClassesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="process-test",
      defaultPhase=PROCESS_TEST_CLASSES,
      requiresDependencyResolution=TEST)
public class ProcessTestClassesMojo
extends org.apache.maven.plugin.AbstractMojo

Processes test classes compiled with Java 8 so that they will be compatible with Java 5, 6 or 7 runtime.


Field Summary
 boolean defaultMethods
          Whether to backport default methods and static methods on interfaces.
 boolean fork
          Forces Retrolambda to run in a separate process.
 File java8home
          Directory of the Java 8 installation for running Retrolambda.
protected  org.apache.maven.project.MavenProject project
           
 boolean quiet
          Reduces the amount of logging.
 String target
          The Java version targeted by the bytecode processing.
 File testInputDir
          Directory containing the original classes compiled with Java 8.
 File testOutputDir
          Directory where to write the backported classes.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ProcessTestClassesMojo()
           
 
Method Summary
 void execute()
           
protected  List<String> getClasspathElements()
           
protected  File getInputDir()
           
protected  File getOutputDir()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testInputDir

@Parameter(defaultValue="${project.build.testOutputDirectory}",
           property="retrolambdaTestInputDir",
           required=true)
public File testInputDir
Directory containing the original classes compiled with Java 8.

Since:
1.3.0

testOutputDir

@Parameter(defaultValue="${project.build.testOutputDirectory}",
           property="retrolambdaTestOutputDir",
           required=true)
public File testOutputDir
Directory where to write the backported classes. If same as the input directory, will overwrite the original classes.

Since:
1.3.0

project

@Parameter(defaultValue="${project}",
           readonly=true)
protected org.apache.maven.project.MavenProject project

java8home

@Parameter(property="java8home",
           required=false)
public File java8home
Directory of the Java 8 installation for running Retrolambda. The JRE to be used will be determined in priority order:
  1. This parameter
  2. JDK toolchain
  3. Same as Maven

Since:
1.2.0

target

@Parameter(defaultValue="1.7",
           property="retrolambdaTarget",
           required=true)
public String target
The Java version targeted by the bytecode processing. Possible values are 1.5, 1.6, 1.7 and 1.8. After processing the classes will be compatible with the target JVM provided the known limitations are considered. See project documentation for more details.

Since:
1.2.0

defaultMethods

@Parameter(defaultValue="false",
           property="retrolambdaDefaultMethods",
           required=true)
public boolean defaultMethods
Whether to backport default methods and static methods on interfaces. LIMITATIONS: All backported interfaces and all classes which implement them or call their static methods must be backported together, with one execution of Retrolambda.

Since:
2.0.0

quiet

@Parameter(defaultValue="false",
           property="retrolambdaQuiet",
           required=true)
public boolean quiet
Reduces the amount of logging.

Since:
2.4.0

fork

@Parameter(defaultValue="false")
public boolean fork
Forces Retrolambda to run in a separate process. The default is not to fork, in which case Maven has to run under Java 8, or this plugin will fall back to forking. The forked process uses a Java agent hook for capturing the lambda classes generated by Java 8, whereas the non-forked version hooks into internal Java APIs, making it more susceptible to breaking between Java releases.

Since:
1.6.0
Constructor Detail

ProcessTestClassesMojo

public ProcessTestClassesMojo()
Method Detail

getInputDir

protected File getInputDir()

getOutputDir

protected File getOutputDir()

getClasspathElements

protected List<String> getClasspathElements()
                                     throws org.apache.maven.artifact.DependencyResolutionRequiredException
Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2013-2017. All Rights Reserved.