You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/09/08 19:45:32 UTC
svn commit: r1807811 - in /maven/plugins/trunk/maven-jlink-plugin/src:
main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
site/apt/index.apt.vm site/apt/usage.apt.vm
test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
Author: khmarbaise
Date: Fri Sep 8 19:45:31 2017
New Revision: 1807811
URL: http://svn.apache.org/viewvc?rev=1807811&view=rev
Log:
Improved docs
Modified:
maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
maven/plugins/trunk/maven-jlink-plugin/src/site/apt/index.apt.vm
maven/plugins/trunk/maven-jlink-plugin/src/site/apt/usage.apt.vm
maven/plugins/trunk/maven-jlink-plugin/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
Modified: maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java?rev=1807811&r1=1807810&r2=1807811&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java (original)
+++ maven/plugins/trunk/maven-jlink-plugin/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java Fri Sep 8 19:45:31 2017
@@ -233,7 +233,8 @@ public class JLinkMojo
private ZipArchiver zipArchiver;
/**
- * Name of the generated ZIP file.
+ * Name of the generated ZIP file in the <code>target</code> directory.
+ * This will not change the name of the installed/deployed file.
*/
@Parameter( defaultValue = "${project.build.finalName}", readonly = true )
private String finalName;
Modified: maven/plugins/trunk/maven-jlink-plugin/src/site/apt/index.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/src/site/apt/index.apt.vm?rev=1807811&r1=1807810&r2=1807811&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jlink-plugin/src/site/apt/index.apt.vm (original)
+++ maven/plugins/trunk/maven-jlink-plugin/src/site/apt/index.apt.vm Fri Sep 8 19:45:31 2017
@@ -28,7 +28,7 @@
${project.name}
- The JLink Plugin is intended to create a {{{http://openjdk.java.net/jeps/220}Modular Run-Time Images}}
+ The JLink Plugin is intended to create a {{{http://openjdk.java.net/jeps/220}Modular Java Run-Time Images}}
via {{{http://openjdk.java.net/jeps/282}jlink}}.
NOTE: This is an alpha release which means everything can change until we reach the first
Modified: maven/plugins/trunk/maven-jlink-plugin/src/site/apt/usage.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/src/site/apt/usage.apt.vm?rev=1807811&r1=1807810&r2=1807811&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jlink-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/plugins/trunk/maven-jlink-plugin/src/site/apt/usage.apt.vm Fri Sep 8 19:45:31 2017
@@ -59,9 +59,21 @@ Usage
</project>
+-----
- The configuration elements contains the configuration for the plugin
+ The configuration element contains the configuration for the plugin
{{{https://maven.apache.org/guides/mini/guide-configuring-plugins.html}}like any other Maven plugin}}.
-
+ The different elements which can be configured for this plugin can identified by the
+ {{{./plugin-info.html}goals documentation}}.
+
+* Requirements
+
+ Based on the foundation of the plugin it is required to have JDK 9 installed. This means
+ either you have it configured via <<JAVA_HOME>> which means to run the whole
+ Maven build with JDK 9 or via <<Toolchains>>.
+
+ Howto configure Maven related to Toolchains can be read in the
+ {{{https://maven.apache.org/guides/mini/guide-using-toolchains.html}Toolchains documentation}}.
+
+
* Usage of the Maven JLink Plugin
Usually you will use the Maven JLink Plugin to create a Run Time Image from one or more modules within
Modified: maven/plugins/trunk/maven-jlink-plugin/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java?rev=1807811&r1=1807810&r2=1807811&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jlink-plugin/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java (original)
+++ maven/plugins/trunk/maven-jlink-plugin/src/test/java/org/apache/maven/plugins/jlink/AbsractJLinkMojoTest.java Fri Sep 8 19:45:31 2017
@@ -21,11 +21,19 @@ package org.apache.maven.plugins.jlink;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collections;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.Commandline;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
@@ -41,6 +49,7 @@ public class AbsractJLinkMojoTest
public void before()
{
this.mojoMock = mock( AbstractJLinkMojo.class, Mockito.CALLS_REAL_METHODS );
+ when( mojoMock.getLog() ).thenReturn( mock( Log.class ) );
}
@Test
@@ -106,4 +115,25 @@ public class AbsractJLinkMojoTest
assertThat( result ).isEqualTo( "A,B" );
}
+ @Test
+ public void xxx()
+ throws MojoExecutionException, IOException, CommandLineException
+ {
+ Process p = mock( Process.class );
+
+ String b = "Error occured";
+ byte[] bytes = b.getBytes();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ baos.write( bytes );
+
+ when (p.getOutputStream()).thenReturn( baos );
+
+ Commandline cmd = mock( Commandline.class );
+ when (cmd.execute()).thenReturn( p );
+
+ File outputDirectory = mock( File.class );
+
+ mojoMock.executeCommand( cmd, outputDirectory );
+
+ }
}