Author: tchemit Date: 2013-04-23 16:43:01 +0200 (Tue, 23 Apr 2013) New Revision: 596 Url: http://nuiton.org/projects/sandbox/repository/revisions/596 Log: embeddedJREInMAven example Added: embeddedJREInMaven/pom.xml embeddedJREInMaven/src/ embeddedJREInMaven/src/main/ embeddedJREInMaven/src/main/assembly/ embeddedJREInMaven/src/main/assembly/README.txt embeddedJREInMaven/src/main/assembly/full-linux-x64.xml embeddedJREInMaven/src/main/assembly/go.sh embeddedJREInMaven/src/main/java/ embeddedJREInMaven/src/main/java/com/ embeddedJREInMaven/src/main/java/com/codelutin/ embeddedJREInMaven/src/main/java/com/codelutin/tech/ embeddedJREInMaven/src/main/java/com/codelutin/tech/HelloWorld.java Modified: embeddedJREInMaven/ Property changes on: embeddedJREInMaven ___________________________________________________________________ Added: svn:ignore + target .idea *.ipr *.iws *.iml Added: embeddedJREInMaven/pom.xml =================================================================== --- embeddedJREInMaven/pom.xml (rev 0) +++ embeddedJREInMaven/pom.xml 2013-04-23 14:43:01 UTC (rev 596) @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-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"> + + <modelVersion>4.0.0</modelVersion> + + <groupId>com.codelutin.tech</groupId> + <artifactId>embeddedJREInMaven</artifactId> + <version>0.1-SNAPSHOT</version> + + <description> + Example of how to make a archive with a embedded jre. + </description> + + <inceptionYear>2013</inceptionYear> + + <url>http://www.codelutin.com/blog:tech:embarquer_jre</url> + + <scm> + <url> + http://svn.nuiton.org/svn/sandbox/embeddedJREInMaven + </url> + </scm> + + <properties> + + <!-- Last JRE version to use --> + <jreVersion>1.7.21</jreVersion> + + <!-- Archive prefix name --> + <bundlePrefix>${project.artifactId}-${project.version}</bundlePrefix> + + </properties> + + <repositories> + + <!-- To obtain jre bundled as maven artifact --> + <repository> + <id>jvm-repository</id> + <url>http://nexus.nuiton.org/nexus/content/repositories/jvm</url> + <releases> + <enabled>true</enabled> + <checksumPolicy>fail</checksumPolicy> + </releases> + </repository> + </repositories> + + <build> + + <plugins> + + <!-- unpack jre in a directory --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>2.7</version> + <executions> + <execution> + <id>get-linux-x64-jre</id> + <phase>prepare-package</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <outputDirectory> + ${project.build.directory}/jre-linux-x64 + </outputDirectory> + <artifactItems> + <artifactItem> + <groupId>com.oracle</groupId> + <artifactId>jre</artifactId> + <version>${jreVersion}</version> + <type>zip</type> + <classifier>linux-x64</classifier> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + + <!-- create assembly --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.4</version> + <configuration> + <finalName>${bundlePrefix}</finalName> + </configuration> + <executions> + <execution> + <id>assembly-full-linux-x64</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <attach>false</attach> + <descriptors> + <descriptor> + src/main/assembly/full-linux-x64.xml + </descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.4</version> + <configuration> + <archive> + <manifest> + <!--<addClasspath>true</addClasspath>--> + <mainClass>com.codelutin.tech.HelloWorld</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + + </plugins> + + </build> + +</project> Property changes on: embeddedJREInMaven/pom.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: embeddedJREInMaven/src/main/assembly/README.txt =================================================================== --- embeddedJREInMaven/src/main/assembly/README.txt (rev 0) +++ embeddedJREInMaven/src/main/assembly/README.txt 2013-04-23 14:43:01 UTC (rev 596) @@ -0,0 +1,3 @@ +To start launch + +./go.sh \ No newline at end of file Property changes on: embeddedJREInMaven/src/main/assembly/README.txt ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: embeddedJREInMaven/src/main/assembly/full-linux-x64.xml =================================================================== --- embeddedJREInMaven/src/main/assembly/full-linux-x64.xml (rev 0) +++ embeddedJREInMaven/src/main/assembly/full-linux-x64.xml 2013-04-23 14:43:01 UTC (rev 596) @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<assembly + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + + <id>full-linux-x64</id> + <formats> + <format>zip</format> + </formats> + + <fileSets> + + <fileSet> + <directory>${project.build.directory}/jre-linux-x64/jre</directory> + <outputDirectory>/jre</outputDirectory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + + <fileSet> + <directory>src/main/assembly</directory> + <outputDirectory/> + <filtered>true</filtered> + <fileMode>0755</fileMode> + <includes> + <include>go.sh</include> + <include>README.txt</include> + </includes> + </fileSet> + + <fileSet> + <directory>target</directory> + <outputDirectory/> + <includes> + <include>${project.build.finalName}.${project.packaging}</include> + </includes> + </fileSet> + + </fileSets> + +</assembly> Property changes on: embeddedJREInMaven/src/main/assembly/full-linux-x64.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: embeddedJREInMaven/src/main/assembly/go.sh =================================================================== --- embeddedJREInMaven/src/main/assembly/go.sh (rev 0) +++ embeddedJREInMaven/src/main/assembly/go.sh 2013-04-23 14:43:01 UTC (rev 596) @@ -0,0 +1,3 @@ +#!/bin/sh + +./jre/bin/java -jar ${project.build.finalName}.${project.packaging} $* Property changes on: embeddedJREInMaven/src/main/assembly/go.sh ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Added: embeddedJREInMaven/src/main/java/com/codelutin/tech/HelloWorld.java =================================================================== --- embeddedJREInMaven/src/main/java/com/codelutin/tech/HelloWorld.java (rev 0) +++ embeddedJREInMaven/src/main/java/com/codelutin/tech/HelloWorld.java 2013-04-23 14:43:01 UTC (rev 596) @@ -0,0 +1,12 @@ +package com.codelutin.tech; + +/** + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class HelloWorld { + + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} Property changes on: embeddedJREInMaven/src/main/java/com/codelutin/tech/HelloWorld.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native