Skip to content

Commit

Permalink
fix #9 zip distribution for jooby
Browse files Browse the repository at this point in the history
* executable from: mvn clean package
  • Loading branch information
jknack committed Dec 13, 2014
1 parent 3f4ad4b commit cac6b4b
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 0 deletions.
18 changes: 18 additions & 0 deletions jooby-dist/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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/maven-v4_0_0.xsd">

<parent>
<groupId>org.jooby</groupId>
<artifactId>jooby-project</artifactId>
<version>0.2.2-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>jooby-dist</artifactId>

<name>jooby-dist</name>

<description>Distribute Jooby applications as zip, tar, etc.</description>

</project>
52 changes: 52 additions & 0 deletions jooby-dist/src/main/resources/assemblies/jooby.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<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>jooby</id>

<baseDirectory>/</baseDirectory>
<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>original-*.jar</exclude>
</excludes>
<includes>
<include>*.jar</include>
</includes>
</fileSet>

<fileSet>
<directory>${project.basedir}${file.separator}etc/bin</directory>
<filtered>true</filtered>
<outputDirectory>/</outputDirectory>
<fileMode>544</fileMode>
<includes>
<include>**/*.sh</include>
</includes>
</fileSet>

<fileSet>
<directory>
${project.basedir}${file.separator}config
</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>

<fileSet>
<directory>
${project.basedir}${file.separator}public
</directory>
<outputDirectory>public</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>

</fileSets>
</assembly>
85 changes: 85 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<module>jooby-hbm</module>
<module>jooby-archetype</module>
<module>jooby-maven-plugin</module>
<module>jooby-dist</module>
</modules>

<licenses>
Expand Down Expand Up @@ -472,6 +473,7 @@

<pluginManagement>
<plugins>
<!-- shade -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -522,6 +524,49 @@
</execution>
</executions>
</plugin>

<!-- ant plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.4</version>
</dependency>
</dependencies>
</plugin>

<!-- Zip -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby-dist</artifactId>
<version>${jooby.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jooby</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

Expand Down Expand Up @@ -601,6 +646,45 @@
</build>
</profile>

<!-- distributions -->
<profile>
<id>zip</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<makeurl file="${settings.localRepository}" property="m2.home" />
<property name="script.loc"
value="jar:${m2.home}/org/jooby/jooby/${jooby.version}/jooby-${jooby.version}.jar!/etc/dist.zip.ant" />
<property name="zip.ant"
value="${project.build.directory}${file.separator}dist.zip.ant" />
<loadresource property="script.body">
<url url="${script.loc}" />
</loadresource>
<echo file="${zip.ant}">${script.body}</echo>
<property name="project.build.finalName" value="${project.build.finalName}" />
<property name="project.build.directory" value="${project.build.directory}" />
<property name="project.name" value="${project.name}" />
<property name="application.main" value="${application.main}" />
<ant antfile="${zip.ant}" target="zip" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>coverage</id>
<build>
Expand Down Expand Up @@ -974,6 +1058,7 @@
<maven-site-plugin.version>3.4</maven-site-plugin.version>
<license-maven-plugin.version>2.6</license-maven-plugin.version>
<jacoco-maven-plugin.version>${jacoco.version}</jacoco-maven-plugin.version>
<maven-assembly-plugin.version>2.5.2</maven-assembly-plugin.version>

<jooby.version>${project.version}</jooby.version>
</properties>
Expand Down

0 comments on commit cac6b4b

Please sign in to comment.