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/02 15:32:34 UTC

svn commit: r1807059 - in /maven/plugins/trunk/maven-jlink-plugin: deploySite.sh pom.xml src/site/apt/usage.apt.vm

Author: khmarbaise
Date: Sat Sep  2 15:32:34 2017
New Revision: 1807059

URL: http://svn.apache.org/viewvc?rev=1807059&view=rev
Log:
Added deploySite.sh script for later deployment of the site.
Enhanced the documentation added first example usage for maven-jlink-plugin
to the site.

Added:
    maven/plugins/trunk/maven-jlink-plugin/deploySite.sh   (with props)
Modified:
    maven/plugins/trunk/maven-jlink-plugin/pom.xml
    maven/plugins/trunk/maven-jlink-plugin/src/site/apt/usage.apt.vm

Added: maven/plugins/trunk/maven-jlink-plugin/deploySite.sh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/deploySite.sh?rev=1807059&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jlink-plugin/deploySite.sh (added)
+++ maven/plugins/trunk/maven-jlink-plugin/deploySite.sh Sat Sep  2 15:32:34 2017
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+mvn -Preporting site site:stage $@
+mvn scm-publish:publish-scm $@

Propchange: maven/plugins/trunk/maven-jlink-plugin/deploySite.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: maven/plugins/trunk/maven-jlink-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/pom.xml?rev=1807059&r1=1807058&r2=1807059&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jlink-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-jlink-plugin/pom.xml Sat Sep  2 15:32:34 2017
@@ -20,7 +20,8 @@
 -->
 
 <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/xsd/maven-4.0.0.xsd">
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+>
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -45,10 +46,10 @@
 
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/
-    </developerConnection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-jlink-plugin/</developerConnection>
     <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jlink-plugin/</url>
   </scm>
+
   <issueManagement>
     <system>jira</system>
     <url>https://issues.apache.org/jira/browse/MJLINK</url>
@@ -92,7 +93,7 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
       <version>3.5</version>
-    </dependency> 
+    </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>

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=1807059&r1=1807058&r2=1807059&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 Sat Sep  2 15:32:34 2017
@@ -27,13 +27,14 @@ Usage
 
 * Introduction
 
-  The Maven JLink Pluing will be used to create a Java Run-Time Image.
+  The Maven JLink plugin is used to create {{{http://openjdk.java.net/jeps/220}Modular Run-Time Images}} with
+  JDK 9.
   
-* Configuring the JLink Plugin
-
-  The configuration of the JLink Plugin is a bit different from the configuration
-  of any other plugin. The configuration should look like this:
+* Configuration of the Maven JLink Plugin
 
+  To use the Maven JLink Plugin you have to configure it as an <<<extensions>>> which means
+  the configuration in your pom file looks like this:
+  
 +-----
 <project>
   [...]
@@ -54,5 +55,187 @@ Usage
 +-----
 
   The configuration elements contains the configuration for the plugin like
-  other Maven plugins.
+  any other Maven plugins.
+
+  
+* 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 
+  a multi module build. In other words it is not possible to create a Run Time Image from a single Maven
+  Project within the same single Maven Project.
+  Let us assume you have a multi module structure which contains two modules <<mod-1>> and <<mod-2>> 
+  which you like to put into the resulting Run Time Image.
+
+  The parent of the multi module looks similar like this:  
   
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.maven</groupId>
+    <artifactId>maven-parent</artifactId>
+    <version>2.3.1</version>
+  </parent>
+  <groupId>com.corporate.project</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+   [...]
+  <modules>
+    <module>mod-1</module>
+    <module>mod-2</module>
+  </modules>  
+   [...]
+</project>
++-----
+
+  A directory structure of such a project looks like this:
+  
++-----
+.
+├── mod-1
+│   └── src
+└── mod-2
+    └── src
++-----
+
+  The <<mod-1>> module looks similar like this:
+  
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mod-1</artifactId>
+   [...]
+</project>
++-----
+
+  The <<mod-2>> module looks similar like this:
+  
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mod-2</artifactId>
+   [...]
+</project>
++-----
+
+  If you like to create a Java Run Time Image of your modules the way is to create a 
+  separate module <<mod-jlink>> which contains the configuration to create the Run 
+  Time Image which looks similar like this:
+
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <packaging>jlink</packaging>
+  <artifactId>mod-jlink</artifactId>
+   [...]
+</project>
++-----
+
+  The directory structure now looks like this:
+  
++-----
+.
+├── mod-1
+│   └── src
+├── mod-2
+│   └── src
+└── mod-jlink
+    └── src
++-----
+
+  Before you can do this you have to add the configuration to the parent like shown 
+  in {{{Configuration_of_the_Maven_JLink_Plugin}Configuration of the Maven JLink Plugin}}.
+
+  Now you need to define which modules will be linked into the resulting Java Run Time Image which simply
+  being done by defining the modules as dependencies to your <<mod-jlink>> module like this:
+  
++-----
+<project ...>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.corporate.project</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <packaging>jlink</packaging>
+  <artifactId>mod-jlink</artifactId>
+ <dependencies>
+    <dependency>
+      <groupId>com.corporate.project</groupId>
+      <artifactId>mod-1</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.corporate.project</groupId>
+      <artifactId>mod-2</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>  
+   [...]
+</project>
++-----
+  
+  
+  After you have added the appropriate configuration you can simply create the Java Run Time Image by
+  calling from the root of your directory structure:
+  
++----
+mvn clean package
++----
+
+  There will be some output lines like this:
+
++----
+[INFO]
+[INFO] --- maven-jlink-plugin:${project.version}:jlink (default-jlink) @ mod-jlink ---
+[INFO] Toolchain in maven-jlink-plugin: jlink [ /.../jdk1.9.0_ea+181.jdk/Contents/Home/bin/jlink ]
+[INFO] The following dependencies will be linked into the runtime image:
+[INFO]  -> com.corporate.project:mod-1:jar:1.0-SNAPSHOT
+[INFO]  -> com.corporate.project:mod-2:jar:1.0-SNAPSHOT
+[INFO] Building zip: /.../mod-jlink/target/mod-jlink-1.0-SNAPSHOT.zip
+[INFO]
++----
+
+  If you like to install the resulting Java Run Time Image you can of course use:
+  
++----
+mvn clean install
++----
+  
+  or if you like to deploy the resulting artifacts to a remote repository you have to use:
+  
++----
+mvn clean deploy
++----
+  
+  At the moment the resulting Java Run Time Image is packaged into a <<zip>> archive which 
+  used to transport the whole structure which is created by <<jlink>> to a repository.
+
+  The basic structure of the resulting Java Run Time Image looks like this:
+  
++---
+jlink/
+├── bin
+├── conf
+├── include
+├── legal
+├── lib
+└── release
++---
+