From 1b7f8ba25482a74522474b50e78136ee17cd5e64 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Wed, 16 Apr 2014 22:43:42 +1000 Subject: [PATCH 01/20] create plugin from archetype --- retrolambda-maven-plugin/pom.xml | 111 ++++++++++++++++++ retrolambda-maven-plugin/src/it/settings.xml | 55 +++++++++ .../src/it/simple-it/pom.xml | 34 ++++++ .../src/it/simple-it/verify.groovy | 3 + .../orfjackal/retrolambda/maven/MyMojo.java | 84 +++++++++++++ 5 files changed, 287 insertions(+) create mode 100644 retrolambda-maven-plugin/pom.xml create mode 100644 retrolambda-maven-plugin/src/it/settings.xml create mode 100644 retrolambda-maven-plugin/src/it/simple-it/pom.xml create mode 100644 retrolambda-maven-plugin/src/it/simple-it/verify.groovy create mode 100644 retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java diff --git a/retrolambda-maven-plugin/pom.xml b/retrolambda-maven-plugin/pom.xml new file mode 100644 index 00000000..d6674d69 --- /dev/null +++ b/retrolambda-maven-plugin/pom.xml @@ -0,0 +1,111 @@ + + 4.0.0 + + net.orfjackal.retrolambda + retrolambda-maven-plugin + 1.1.5-SNAPSHOT + maven-plugin + + retrolambda-maven-plugin Maven Plugin + + + http://maven.apache.org + + + UTF-8 + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.2 + provided + + + org.codehaus.plexus + plexus-utils + 3.0.8 + + + junit + junit + 4.8.2 + test + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.2 + + retrolambda-maven-plugin + true + + + + mojo-descriptor + + descriptor + + + + help-goal + + helpmojo + + + + + + + + + run-its + + + + + org.apache.maven.plugins + maven-invoker-plugin + 1.7 + + true + ${project.build.directory}/it + + */pom.xml + + verify + ${project.build.directory}/local-repo + src/it/settings.xml + + clean + test-compile + + + + + integration-test + + install + integration-test + verify + + + + + + + + + + diff --git a/retrolambda-maven-plugin/src/it/settings.xml b/retrolambda-maven-plugin/src/it/settings.xml new file mode 100644 index 00000000..c8f77f0b --- /dev/null +++ b/retrolambda-maven-plugin/src/it/settings.xml @@ -0,0 +1,55 @@ + + + + + + + + it-repo + + true + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + diff --git a/retrolambda-maven-plugin/src/it/simple-it/pom.xml b/retrolambda-maven-plugin/src/it/simple-it/pom.xml new file mode 100644 index 00000000..a229afc7 --- /dev/null +++ b/retrolambda-maven-plugin/src/it/simple-it/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + net.orfjackal.retrolambda.it + simple-it + 1.0-SNAPSHOT + + A simple IT verifying the basic use case. + + + UTF-8 + + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + touch + validate + + touch + + + + + + + diff --git a/retrolambda-maven-plugin/src/it/simple-it/verify.groovy b/retrolambda-maven-plugin/src/it/simple-it/verify.groovy new file mode 100644 index 00000000..7b307c78 --- /dev/null +++ b/retrolambda-maven-plugin/src/it/simple-it/verify.groovy @@ -0,0 +1,3 @@ +File touchFile = new File( basedir, "target/touch.txt" ); + +assert touchFile.isFile() diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java new file mode 100644 index 00000000..694a59d4 --- /dev/null +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java @@ -0,0 +1,84 @@ +package net.orfjackal.retrolambda.maven; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; + +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; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +/** + * Goal which touches a timestamp file. + * + * @deprecated Don't use! + */ +@Mojo( name = "touch", defaultPhase = LifecyclePhase.PROCESS_SOURCES ) +public class MyMojo + extends AbstractMojo +{ + /** + * Location of the file. + */ + @Parameter( defaultValue = "${project.build.directory}", property = "outputDir", required = true ) + private File outputDirectory; + + public void execute() + throws MojoExecutionException + { + File f = outputDirectory; + + if ( !f.exists() ) + { + f.mkdirs(); + } + + File touch = new File( f, "touch.txt" ); + + FileWriter w = null; + try + { + w = new FileWriter( touch ); + + w.write( "touch.txt" ); + } + catch ( IOException e ) + { + throw new MojoExecutionException( "Error creating file " + touch, e ); + } + finally + { + if ( w != null ) + { + try + { + w.close(); + } + catch ( IOException e ) + { + // ignore + } + } + } + } +} From d957c3c8b6761ca53703a6074b033eb0843d2dde Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Wed, 16 Apr 2014 22:54:44 +1000 Subject: [PATCH 02/20] use mojo-executor as dep --- retrolambda-maven-plugin/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/retrolambda-maven-plugin/pom.xml b/retrolambda-maven-plugin/pom.xml index d6674d69..eabba04b 100644 --- a/retrolambda-maven-plugin/pom.xml +++ b/retrolambda-maven-plugin/pom.xml @@ -33,6 +33,11 @@ plexus-utils 3.0.8 + + org.twdata.maven + mojo-executor + 2.2.0 + junit junit From 101e1146d62b78beb0aa07285c1d3caf391ada5c Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 07:40:10 +1000 Subject: [PATCH 03/20] add eclipse project dot files to .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 56256e4e..43d35826 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /target/ /*/target/ +.classpath +.settings +.project From 29e14b2f72bee225d20c94fbf3f72c570fcbcf65 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 07:41:10 +1000 Subject: [PATCH 04/20] develop plugin --- .../orfjackal/retrolambda/maven/MyMojo.java | 84 ------------------- .../retrolambda/maven/RetrolambdaMojo.java | 78 +++++++++++++++++ 2 files changed, 78 insertions(+), 84 deletions(-) delete mode 100644 retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java create mode 100644 retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java deleted file mode 100644 index 694a59d4..00000000 --- a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/MyMojo.java +++ /dev/null @@ -1,84 +0,0 @@ -package net.orfjackal.retrolambda.maven; - -/* - * Copyright 2001-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -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; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -/** - * Goal which touches a timestamp file. - * - * @deprecated Don't use! - */ -@Mojo( name = "touch", defaultPhase = LifecyclePhase.PROCESS_SOURCES ) -public class MyMojo - extends AbstractMojo -{ - /** - * Location of the file. - */ - @Parameter( defaultValue = "${project.build.directory}", property = "outputDir", required = true ) - private File outputDirectory; - - public void execute() - throws MojoExecutionException - { - File f = outputDirectory; - - if ( !f.exists() ) - { - f.mkdirs(); - } - - File touch = new File( f, "touch.txt" ); - - FileWriter w = null; - try - { - w = new FileWriter( touch ); - - w.write( "touch.txt" ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Error creating file " + touch, e ); - } - finally - { - if ( w != null ) - { - try - { - w.close(); - } - catch ( IOException e ) - { - // ignore - } - } - } - } -} diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java new file mode 100644 index 00000000..d1a2b498 --- /dev/null +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java @@ -0,0 +1,78 @@ +package net.orfjackal.retrolambda.maven; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import static org.twdata.maven.mojoexecutor.MojoExecutor.artifactId; +import static org.twdata.maven.mojoexecutor.MojoExecutor.configuration; +import static org.twdata.maven.mojoexecutor.MojoExecutor.element; +import static org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo; +import static org.twdata.maven.mojoexecutor.MojoExecutor.executionEnvironment; +import static org.twdata.maven.mojoexecutor.MojoExecutor.goal; +import static org.twdata.maven.mojoexecutor.MojoExecutor.groupId; +import static org.twdata.maven.mojoexecutor.MojoExecutor.name; +import static org.twdata.maven.mojoexecutor.MojoExecutor.plugin; +import static org.twdata.maven.mojoexecutor.MojoExecutor.version; + +import java.io.File; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.MojoExecutionException; +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.project.MavenProject; + +@Mojo(name = "process", defaultPhase = LifecyclePhase.PROCESS_CLASSES) +public class RetrolambdaMojo extends AbstractMojo { + + @Component + private MavenSession session; + + @Component + private BuildPluginManager pluginManager; + + @Component + private MavenProject project; + + /** + * Location of the file. + */ + @Parameter(defaultValue = "${project.build.directory}", property = "outputDir", required = true) + private File outputDirectory; + + public void execute() throws MojoExecutionException { + executeMojo( + plugin(groupId("org.apache.maven.plugins"), + artifactId("maven-dependency-plugin"), version("2.0")), + goal("copy"), + configuration(element( + "artifactItems", + element("artifactItem", + element(name("groupId"), + "net.orfjackal.retrolambda"), + element(name("artifactId"), "retrolambda"), + element(name("version"), "1.1.4"), + element(name("overwrite"), "true"), + element(name("outputDirectory"), project + .getBuild().getOutputDirectory()), + element(name("destFileName"), "retrolambda.jar")))), + executionEnvironment(project, session, pluginManager)); + } +} From ec3c55b307ed1738202459decd9026dbbdd009f0 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 09:41:55 +1000 Subject: [PATCH 05/20] develop maven plugin --- pom.xml | 2 + retrolambda-maven-plugin-test/pom.xml | 29 +++ retrolambda-maven-plugin/pom.xml | 237 ++++++++++-------- .../retrolambda/maven/RetrolambdaMojo.java | 26 +- .../src/main/resources/retrolambda.properties | 1 + 5 files changed, 186 insertions(+), 109 deletions(-) create mode 100644 retrolambda-maven-plugin-test/pom.xml create mode 100644 retrolambda-maven-plugin/src/main/resources/retrolambda.properties diff --git a/pom.xml b/pom.xml index eec3a15c..f57e0ffb 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,8 @@ parent retrolambda + retrolambda-maven-plugin + retrolambda-maven-plugin-test end-to-end-tests diff --git a/retrolambda-maven-plugin-test/pom.xml b/retrolambda-maven-plugin-test/pom.xml new file mode 100644 index 00000000..795e0ac0 --- /dev/null +++ b/retrolambda-maven-plugin-test/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + + net.orfjackal.retrolambda + parent + 1.1.5-SNAPSHOT + ../parent/pom.xml + + retrolambda-maven-plugin-test + jar + ${project.artifactId} + + + + net.orfjackal.retrolambda + retrolambda-maven-plugin + ${project.parent.version} + + + + process + + + + + + + diff --git a/retrolambda-maven-plugin/pom.xml b/retrolambda-maven-plugin/pom.xml index eabba04b..47a2eabb 100644 --- a/retrolambda-maven-plugin/pom.xml +++ b/retrolambda-maven-plugin/pom.xml @@ -1,116 +1,141 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + net.orfjackal.retrolambda + parent + 1.1.5-SNAPSHOT + ../parent/pom.xml + + retrolambda-maven-plugin + maven-plugin - net.orfjackal.retrolambda - retrolambda-maven-plugin - 1.1.5-SNAPSHOT - maven-plugin + ${project.artifactId} - retrolambda-maven-plugin Maven Plugin + + http://maven.apache.org - - http://maven.apache.org + + UTF-8 + - - UTF-8 - + + + org.apache.maven + maven-plugin-api + 2.0 + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.2 + provided + + + org.codehaus.plexus + plexus-utils + 3.0.8 + + + org.twdata.maven + mojo-executor + 2.2.0 + + + + + junit + junit + test + - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.maven.plugin-tools - maven-plugin-annotations - 3.2 - provided - - - org.codehaus.plexus - plexus-utils - 3.0.8 - - - org.twdata.maven - mojo-executor - 2.2.0 - - - junit - junit - 4.8.2 - test - - + - - - - org.apache.maven.plugins - maven-plugin-plugin - 3.2 - - retrolambda-maven-plugin - true - - - - mojo-descriptor - - descriptor - - - - help-goal - - helpmojo - - - - - - - - - run-its - + + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + true + true + 1.6 + 1.6 + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.2 + + retrolambda + true + + + + mojo-descriptor + + descriptor + + process-classes + + + help-goal + + helpmojo + + process-classes + + + + + + + + run-its + - - - org.apache.maven.plugins - maven-invoker-plugin - 1.7 - - true - ${project.build.directory}/it - - */pom.xml - - verify - ${project.build.directory}/local-repo - src/it/settings.xml - - clean - test-compile - - - - - integration-test - - install - integration-test - verify - - - - - + + + org.apache.maven.plugins + maven-invoker-plugin + 1.7 + + true + ${project.build.directory}/it + + */pom.xml + + verify + ${project.build.directory}/local-repo + src/it/settings.xml + + clean + test-compile + + + + + integration-test + + install + integration-test + verify + + + + + - - - + + + diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java index d1a2b498..81ec41ad 100644 --- a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java @@ -28,11 +28,15 @@ import static org.twdata.maven.mojoexecutor.MojoExecutor.version; import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.BuildPluginManager; import org.apache.maven.plugin.MojoExecutionException; +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; @@ -57,7 +61,11 @@ public class RetrolambdaMojo extends AbstractMojo { @Parameter(defaultValue = "${project.build.directory}", property = "outputDir", required = true) private File outputDirectory; + @Override public void execute() throws MojoExecutionException { + Log log = getLog(); + log.info("starting execution"); + String retrolambdaVersion = getRetrolambdaVersion(); executeMojo( plugin(groupId("org.apache.maven.plugins"), artifactId("maven-dependency-plugin"), version("2.0")), @@ -68,11 +76,23 @@ public void execute() throws MojoExecutionException { element(name("groupId"), "net.orfjackal.retrolambda"), element(name("artifactId"), "retrolambda"), - element(name("version"), "1.1.4"), - element(name("overwrite"), "true"), + element(name("version"), retrolambdaVersion), + element(name("overWrite"), "true"), element(name("outputDirectory"), project - .getBuild().getOutputDirectory()), + .getBuild().getDirectory()), element(name("destFileName"), "retrolambda.jar")))), executionEnvironment(project, session, pluginManager)); } + + private static String getRetrolambdaVersion() { + InputStream is = RetrolambdaMojo.class + .getResourceAsStream("/retrolambda.properties"); + Properties p = new Properties(); + try { + p.load(is); + return p.getProperty("retrolambda.version"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } diff --git a/retrolambda-maven-plugin/src/main/resources/retrolambda.properties b/retrolambda-maven-plugin/src/main/resources/retrolambda.properties new file mode 100644 index 00000000..23f123d4 --- /dev/null +++ b/retrolambda-maven-plugin/src/main/resources/retrolambda.properties @@ -0,0 +1 @@ +retrolambda.version=${project.version} \ No newline at end of file From e2f7ad16cd5fb4e22c3b9fc8cdfb48d667bab0f9 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 14:15:25 +1000 Subject: [PATCH 06/20] add lambda main source and test source --- retrolambda-maven-plugin-test/pom.xml | 8 +- .../net/orfjackal/retrolambda/Example.java | 13 +++ .../orfjackal/retrolambda/ExampleTest.java | 11 +++ .../retrolambda/maven/RetrolambdaMojo.java | 86 +++++++++++++++++-- 4 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/Example.java create mode 100644 retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/ExampleTest.java diff --git a/retrolambda-maven-plugin-test/pom.xml b/retrolambda-maven-plugin-test/pom.xml index 795e0ac0..149aa766 100644 --- a/retrolambda-maven-plugin-test/pom.xml +++ b/retrolambda-maven-plugin-test/pom.xml @@ -12,6 +12,12 @@ ${project.artifactId} + + maven-deploy-plugin + + true + + net.orfjackal.retrolambda retrolambda-maven-plugin @@ -25,5 +31,5 @@ - + diff --git a/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/Example.java b/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/Example.java new file mode 100644 index 00000000..7f40a786 --- /dev/null +++ b/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/Example.java @@ -0,0 +1,13 @@ +package net.orfjackal.retrolambda; + +import java.util.function.Consumer; + +public class Example { + + public static void main(String[] args) { + Consumer c = (Integer x) -> { + System.out.println(x); + }; + c.accept(12); + } +} diff --git a/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/ExampleTest.java b/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/ExampleTest.java new file mode 100644 index 00000000..1f112bf6 --- /dev/null +++ b/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/ExampleTest.java @@ -0,0 +1,11 @@ +package net.orfjackal.retrolambda; + +import org.junit.Test; + +public class ExampleTest { + + @Test + public void test() { + Example.main(null); + } +} diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java index 81ec41ad..5c94d59f 100644 --- a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java @@ -17,6 +17,8 @@ */ import static org.twdata.maven.mojoexecutor.MojoExecutor.artifactId; +import static org.twdata.maven.mojoexecutor.MojoExecutor.attribute; +import static org.twdata.maven.mojoexecutor.MojoExecutor.attributes; import static org.twdata.maven.mojoexecutor.MojoExecutor.configuration; import static org.twdata.maven.mojoexecutor.MojoExecutor.element; import static org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo; @@ -46,6 +48,8 @@ @Mojo(name = "process", defaultPhase = LifecyclePhase.PROCESS_CLASSES) public class RetrolambdaMojo extends AbstractMojo { + private static final String RETROLAMBDA_JAR = "retrolambda.jar"; + @Component private MavenSession session; @@ -55,11 +59,17 @@ public class RetrolambdaMojo extends AbstractMojo { @Component private MavenProject project; - /** - * Location of the file. - */ - @Parameter(defaultValue = "${project.build.directory}", property = "outputDir", required = true) - private File outputDirectory; + @Parameter(required = false, property = "java8home") + private String java8home; + + @Parameter(required = false, property = "bytecodeVersion") + private String bytecodeVersion; + + @Parameter(required = false, property = "retrolambdaInputDir") + private String inputDir; + + @Parameter(required = false, property = "retrolambdaInputTestDir") + private String inputTestDir; @Override public void execute() throws MojoExecutionException { @@ -80,8 +90,72 @@ public void execute() throws MojoExecutionException { element(name("overWrite"), "true"), element(name("outputDirectory"), project .getBuild().getDirectory()), - element(name("destFileName"), "retrolambda.jar")))), + element(name("destFileName"), RETROLAMBDA_JAR)))), executionEnvironment(project, session, pluginManager)); + log.info("copied retrolambda.jar to build directory"); + + if (inputDir == null) + inputDir = project.getBuild().getOutputDirectory(); + if (inputTestDir == null) + inputTestDir = project.getBuild().getTestOutputDirectory(); + + // process main classes + processClasses(inputDir, "maven.compile.classpath"); + + // process test classes + processClasses(inputTestDir, "maven.test.classpath"); + + } + + private void processClasses(String input, String classpathId) + throws MojoExecutionException { + if (bytecodeVersion == null) + bytecodeVersion = "51"; + + executeMojo( + plugin(groupId("org.apache.maven.plugins"), + artifactId("maven-antrun-plugin"), version("1.7")), + goal("run"), + configuration(element( + "target", + element("property", + attributes(attribute("name", "the_classpath"), + attribute("refid", classpathId))), + element("exec", + attributes( + attribute("executable", java8home() + + "/bin/java"), + attribute("failonerror", "true")), + element("arg", + attribute("value", + "-Dretrolambda.bytecodeVersion=" + + bytecodeVersion)), + element("arg", + attribute("value", + "-Dretrolambda.inputDir=" + + input)), + element("arg", + attribute("value", + "-Dretrolambda.classpath=${the_classpath}")), + element("arg", + attribute("value", "-javaagent:" + + project.getBuild() + .getDirectory() + "/" + + RETROLAMBDA_JAR)), + element("arg", attribute("value", "-jar")), + element("arg", + attribute("value", project.getBuild() + .getDirectory() + + "/" + + RETROLAMBDA_JAR))))), + executionEnvironment(project, session, pluginManager)); + } + + private String java8home() { + if (java8home != null) + return new File(java8home).getAbsolutePath(); + else + return System.getenv("JAVA8_HOME"); } private static String getRetrolambdaVersion() { From be8c3b3d4f4cf330f1417dd7a231939107042f93 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 15:31:01 +1000 Subject: [PATCH 07/20] develop maven plugin --- end-to-end-tests/pom.xml | 18 +++- parent/pom.xml | 4 +- retrolambda-maven-plugin-test/pom.xml | 3 +- .../retrolambda/{ => test}/Example.java | 2 +- .../retrolambda/{ => test}/ExampleTest.java | 4 +- retrolambda-maven-plugin/pom.xml | 1 - .../retrolambda/maven/ClassesType.java | 5 ++ ...ambdaMojo.java => ProcessClassesMojo.java} | 86 +++++++------------ .../maven/ProcessMainClassesMojo.java | 13 +++ .../maven/ProcessTestClassesMojo.java | 12 +++ 10 files changed, 88 insertions(+), 60 deletions(-) rename retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/{ => test}/Example.java (83%) rename retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/{ => test}/ExampleTest.java (55%) create mode 100644 retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ClassesType.java rename retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/{RetrolambdaMojo.java => ProcessClassesMojo.java} (67%) create mode 100644 retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java create mode 100644 retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java diff --git a/end-to-end-tests/pom.xml b/end-to-end-tests/pom.xml index 8c90f19c..e9469da2 100644 --- a/end-to-end-tests/pom.xml +++ b/end-to-end-tests/pom.xml @@ -47,7 +47,23 @@ + + net.orfjackal.retrolambda + retrolambda-maven-plugin + ${project.parent.version} + + + + process-main + process-test + + + + + + + diff --git a/parent/pom.xml b/parent/pom.xml index e2815777..1c2cbf3f 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -283,12 +283,12 @@ maven-plugin-plugin - 3.1 + 3.2 maven-site-plugin - 3.1 + 3.3 diff --git a/retrolambda-maven-plugin-test/pom.xml b/retrolambda-maven-plugin-test/pom.xml index 149aa766..9a3fefb5 100644 --- a/retrolambda-maven-plugin-test/pom.xml +++ b/retrolambda-maven-plugin-test/pom.xml @@ -25,7 +25,8 @@ - process + process-main + process-test diff --git a/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/Example.java b/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/test/Example.java similarity index 83% rename from retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/Example.java rename to retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/test/Example.java index 7f40a786..dac9e71b 100644 --- a/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/Example.java +++ b/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/test/Example.java @@ -1,4 +1,4 @@ -package net.orfjackal.retrolambda; +package net.orfjackal.retrolambda.test; import java.util.function.Consumer; diff --git a/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/ExampleTest.java b/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/test/ExampleTest.java similarity index 55% rename from retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/ExampleTest.java rename to retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/test/ExampleTest.java index 1f112bf6..c237ee0a 100644 --- a/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/ExampleTest.java +++ b/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/test/ExampleTest.java @@ -1,4 +1,6 @@ -package net.orfjackal.retrolambda; +package net.orfjackal.retrolambda.test; + +import net.orfjackal.retrolambda.test.Example; import org.junit.Test; diff --git a/retrolambda-maven-plugin/pom.xml b/retrolambda-maven-plugin/pom.xml index 47a2eabb..acda8d36 100644 --- a/retrolambda-maven-plugin/pom.xml +++ b/retrolambda-maven-plugin/pom.xml @@ -63,7 +63,6 @@ org.apache.maven.plugins maven-compiler-plugin - 3.1 true true diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ClassesType.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ClassesType.java new file mode 100644 index 00000000..22058cd3 --- /dev/null +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ClassesType.java @@ -0,0 +1,5 @@ +package net.orfjackal.retrolambda.maven; + +enum ClassesType { + MAIN, TEST; +} diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessClassesMojo.java similarity index 67% rename from retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java rename to retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessClassesMojo.java index 5c94d59f..59e3465b 100644 --- a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/RetrolambdaMojo.java +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessClassesMojo.java @@ -1,21 +1,5 @@ package net.orfjackal.retrolambda.maven; -/* - * Copyright 2001-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import static org.twdata.maven.mojoexecutor.MojoExecutor.artifactId; import static org.twdata.maven.mojoexecutor.MojoExecutor.attribute; import static org.twdata.maven.mojoexecutor.MojoExecutor.attributes; @@ -29,7 +13,6 @@ import static org.twdata.maven.mojoexecutor.MojoExecutor.plugin; import static org.twdata.maven.mojoexecutor.MojoExecutor.version; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Properties; @@ -40,16 +23,21 @@ import org.apache.maven.plugin.MojoExecutionException; 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.project.MavenProject; -@Mojo(name = "process", defaultPhase = LifecyclePhase.PROCESS_CLASSES) -public class RetrolambdaMojo extends AbstractMojo { +abstract class ProcessClassesMojo extends AbstractMojo { + + private static final String VERSION_ANTRUN = "1.7"; + + private static final String ARTIFACT_ID_ANTRUN = "maven-antrun-plugin"; + + private static final String GROUP_ID_ANTRUN = "org.apache.maven.plugins"; private static final String RETROLAMBDA_JAR = "retrolambda.jar"; + private static final int DEFAULT_BYTE_CODE_VERSION = 51; + @Component private MavenSession session; @@ -59,17 +47,24 @@ public class RetrolambdaMojo extends AbstractMojo { @Component private MavenProject project; - @Parameter(required = false, property = "java8home") + @Parameter(required = false, property = "java8home", defaultValue = "${env.JAVA8_HOME}") private String java8home; - @Parameter(required = false, property = "bytecodeVersion") + @Parameter(required = false, property = "bytecodeVersion", defaultValue = DEFAULT_BYTE_CODE_VERSION + + "") private String bytecodeVersion; - @Parameter(required = false, property = "retrolambdaInputDir") - private String inputDir; + @Parameter(required = false, property = "retrolambdaMainClassesDir", defaultValue = "${project.build.outputDirectory}") + private String mainClassesDir; + + @Parameter(required = false, property = "retrolambdaTestClassesDir", defaultValue = "${project.build.testOutputDirectory}") + private String testClassesDir; - @Parameter(required = false, property = "retrolambdaInputTestDir") - private String inputTestDir; + private final ClassesType classesType; + + ProcessClassesMojo(ClassesType classesType) { + this.classesType = classesType; + } @Override public void execute() throws MojoExecutionException { @@ -77,7 +72,7 @@ public void execute() throws MojoExecutionException { log.info("starting execution"); String retrolambdaVersion = getRetrolambdaVersion(); executeMojo( - plugin(groupId("org.apache.maven.plugins"), + plugin(groupId(GROUP_ID_ANTRUN), artifactId("maven-dependency-plugin"), version("2.0")), goal("copy"), configuration(element( @@ -93,28 +88,20 @@ public void execute() throws MojoExecutionException { element(name("destFileName"), RETROLAMBDA_JAR)))), executionEnvironment(project, session, pluginManager)); log.info("copied retrolambda.jar to build directory"); - - if (inputDir == null) - inputDir = project.getBuild().getOutputDirectory(); - if (inputTestDir == null) - inputTestDir = project.getBuild().getTestOutputDirectory(); - - // process main classes - processClasses(inputDir, "maven.compile.classpath"); - - // process test classes - processClasses(inputTestDir, "maven.test.classpath"); - + log.info("processing classes"); + if (classesType == ClassesType.MAIN) + processClasses(mainClassesDir, "maven.compile.classpath"); + else + processClasses(testClassesDir, "maven.test.classpath"); + log.info("processed classes"); } private void processClasses(String input, String classpathId) throws MojoExecutionException { - if (bytecodeVersion == null) - bytecodeVersion = "51"; executeMojo( - plugin(groupId("org.apache.maven.plugins"), - artifactId("maven-antrun-plugin"), version("1.7")), + plugin(groupId(GROUP_ID_ANTRUN), + artifactId(ARTIFACT_ID_ANTRUN), version(VERSION_ANTRUN)), goal("run"), configuration(element( "target", @@ -123,7 +110,7 @@ private void processClasses(String input, String classpathId) attribute("refid", classpathId))), element("exec", attributes( - attribute("executable", java8home() + attribute("executable", java8home + "/bin/java"), attribute("failonerror", "true")), element("arg", @@ -151,15 +138,8 @@ private void processClasses(String input, String classpathId) executionEnvironment(project, session, pluginManager)); } - private String java8home() { - if (java8home != null) - return new File(java8home).getAbsolutePath(); - else - return System.getenv("JAVA8_HOME"); - } - private static String getRetrolambdaVersion() { - InputStream is = RetrolambdaMojo.class + InputStream is = ProcessClassesMojo.class .getResourceAsStream("/retrolambda.properties"); Properties p = new Properties(); try { diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java new file mode 100644 index 00000000..a9102381 --- /dev/null +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java @@ -0,0 +1,13 @@ +package net.orfjackal.retrolambda.maven; + +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +@Mojo(name = "process-main", defaultPhase = LifecyclePhase.PROCESS_CLASSES) +public class ProcessMainClassesMojo extends ProcessClassesMojo { + + public ProcessMainClassesMojo() { + super(ClassesType.MAIN); + } + +} diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java new file mode 100644 index 00000000..fb3e33bf --- /dev/null +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java @@ -0,0 +1,12 @@ +package net.orfjackal.retrolambda.maven; + +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +@Mojo(name = "process-test", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES) +public class ProcessTestClassesMojo extends ProcessClassesMojo { + + public ProcessTestClassesMojo() { + super(ClassesType.TEST); + } +} \ No newline at end of file From 92a4a83ac6e7c05bc3b263debf75516658691bc2 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 16:06:43 +1000 Subject: [PATCH 08/20] add mojo documentation --- retrolambda-maven-plugin/pom.xml | 34 +++++++++++++++---- .../retrolambda/maven/ProcessClassesMojo.java | 22 ++++++++++++ .../maven/ProcessMainClassesMojo.java | 4 +++ .../maven/ProcessTestClassesMojo.java | 4 +++ 4 files changed, 57 insertions(+), 7 deletions(-) diff --git a/retrolambda-maven-plugin/pom.xml b/retrolambda-maven-plugin/pom.xml index acda8d36..abbb0727 100644 --- a/retrolambda-maven-plugin/pom.xml +++ b/retrolambda-maven-plugin/pom.xml @@ -12,13 +12,16 @@ ${project.artifactId} - - http://maven.apache.org + https://github.com/orfjackal/retrolambda UTF-8 + + ${minimumMavenVersion} + + org.apache.maven @@ -41,9 +44,6 @@ mojo-executor 2.2.0 - - junit junit @@ -95,13 +95,34 @@ + + org.apache.maven.plugins + maven-site-plugin + 3.3 + + + attach-descriptor + + attach-descriptor + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.2 + + + + run-its - org.apache.maven.plugins @@ -133,7 +154,6 @@ - diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessClassesMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessClassesMojo.java index 59e3465b..88a09c11 100644 --- a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessClassesMojo.java +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessClassesMojo.java @@ -47,21 +47,43 @@ abstract class ProcessClassesMojo extends AbstractMojo { @Component private MavenProject project; + /** + * The location of the java 8 jdk (not jre). + */ @Parameter(required = false, property = "java8home", defaultValue = "${env.JAVA8_HOME}") private String java8home; + /** + * The version of the bytecode to be produced by retrolamda. Defaults to 51 + * which is java 7 compatible bytecode. + */ @Parameter(required = false, property = "bytecodeVersion", defaultValue = DEFAULT_BYTE_CODE_VERSION + "") private String bytecodeVersion; + /** + * The directory containing the main (non-test) compiled classes. These + * classes will be overwritten with bytecode changes to obtain compatibility + * with java 7 runtime. + */ @Parameter(required = false, property = "retrolambdaMainClassesDir", defaultValue = "${project.build.outputDirectory}") private String mainClassesDir; + /** + * The directory containing the compiled test classes. These classes will be + * overwritten with bytecode changes to obtain compatibility with java 7 + * runtime. + */ @Parameter(required = false, property = "retrolambdaTestClassesDir", defaultValue = "${project.build.testOutputDirectory}") private String testClassesDir; private final ClassesType classesType; + /** + * Constructor. + * + * @param classesType + */ ProcessClassesMojo(ClassesType classesType) { this.classesType = classesType; } diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java index a9102381..6bec48bd 100644 --- a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessMainClassesMojo.java @@ -3,6 +3,10 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; +/** + * Processes main (non-test) classes compiled with java 8 so that they are + * compatible with java 7 runtime. + */ @Mojo(name = "process-main", defaultPhase = LifecyclePhase.PROCESS_CLASSES) public class ProcessMainClassesMojo extends ProcessClassesMojo { diff --git a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java index fb3e33bf..d6f2a0f5 100644 --- a/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java +++ b/retrolambda-maven-plugin/src/main/java/net/orfjackal/retrolambda/maven/ProcessTestClassesMojo.java @@ -3,6 +3,10 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; +/** + * Processes test classes compiled with java 8 so that they are compatible with + * java 7 runtime. + */ @Mojo(name = "process-test", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES) public class ProcessTestClassesMojo extends ProcessClassesMojo { From f5807dec9c1488d52a1bb0a8ec15a83ce6adc7ec Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 16:21:31 +1000 Subject: [PATCH 09/20] remove obsolete test project --- pom.xml | 1 - retrolambda-maven-plugin-test/pom.xml | 36 ------------------- .../orfjackal/retrolambda/test/Example.java | 13 ------- .../retrolambda/test/ExampleTest.java | 13 ------- 4 files changed, 63 deletions(-) delete mode 100644 retrolambda-maven-plugin-test/pom.xml delete mode 100644 retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/test/Example.java delete mode 100644 retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/test/ExampleTest.java diff --git a/pom.xml b/pom.xml index f57e0ffb..8ba38404 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,6 @@ parent retrolambda retrolambda-maven-plugin - retrolambda-maven-plugin-test end-to-end-tests diff --git a/retrolambda-maven-plugin-test/pom.xml b/retrolambda-maven-plugin-test/pom.xml deleted file mode 100644 index 9a3fefb5..00000000 --- a/retrolambda-maven-plugin-test/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - 4.0.0 - - net.orfjackal.retrolambda - parent - 1.1.5-SNAPSHOT - ../parent/pom.xml - - retrolambda-maven-plugin-test - jar - ${project.artifactId} - - - - maven-deploy-plugin - - true - - - - net.orfjackal.retrolambda - retrolambda-maven-plugin - ${project.parent.version} - - - - process-main - process-test - - - - - - - diff --git a/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/test/Example.java b/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/test/Example.java deleted file mode 100644 index dac9e71b..00000000 --- a/retrolambda-maven-plugin-test/src/main/java/net/orfjackal/retrolambda/test/Example.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.orfjackal.retrolambda.test; - -import java.util.function.Consumer; - -public class Example { - - public static void main(String[] args) { - Consumer c = (Integer x) -> { - System.out.println(x); - }; - c.accept(12); - } -} diff --git a/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/test/ExampleTest.java b/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/test/ExampleTest.java deleted file mode 100644 index c237ee0a..00000000 --- a/retrolambda-maven-plugin-test/src/test/java/net/orfjackal/retrolambda/test/ExampleTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.orfjackal.retrolambda.test; - -import net.orfjackal.retrolambda.test.Example; - -import org.junit.Test; - -public class ExampleTest { - - @Test - public void test() { - Example.main(null); - } -} From a7588bbb99991bdc46097f6685b2dbb4e7ff1dc1 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Thu, 17 Apr 2014 16:24:49 +1000 Subject: [PATCH 10/20] add to comment --- end-to-end-tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/end-to-end-tests/pom.xml b/end-to-end-tests/pom.xml index e9469da2..7a7869be 100644 --- a/end-to-end-tests/pom.xml +++ b/end-to-end-tests/pom.xml @@ -62,7 +62,7 @@ - + + - - net.orfjackal.retrolambda - retrolambda-maven-plugin - ${project.parent.version} - - - - process-main - process-test - - - - + + net.orfjackal.retrolambda + retrolambda-maven-plugin + ${project.parent.version} + + + + process-main + process-test + + + +