Skip to content

Commit b2d8ee9

Browse files
authored
Merge pull request #43 from DanStout/master
Added a deployment page and fixed a few small spelling/grammar mistakes.
2 parents 4890ef3 + d200611 commit b2d8ee9

File tree

7 files changed

+116
-6
lines changed

7 files changed

+116
-6
lines changed

_posts/2015-03-17-static-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ Pippo pippo = new Pippo();
100100
pippo.getApplication().addFileResourceRoute("/src", "src");
101101
```
102102

103-
From security reason the `FileResourceRoute` doesn't serve resources from outside it's base directory by using relative paths such as `../../../private.txt`.
103+
For security reasons, the `FileResourceRoute` doesn't serve resources from outside its base directory by using relative paths such as `../../../private.txt`.

_posts/2015-03-27-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class MyApplication extends Application {
7575
}
7676
```
7777

78-
A session is available automatically to templates for the rendering page process. So, you can references any session attribute in your template. Bellow see a simple example (using freemarker as template engine):
78+
A session is available automatically to templates for the rendering page process, which allows you to reference any session attribute in your template. Below is a simple example using freemarker as template engine:
7979

8080
```
8181
<#if (session)??>

_posts/2015-04-02-content-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class XstreamEngine implements ContentTypeEngine {
4848

4949
To register a content type engine in your application you have two options:
5050

51-
- add programatically the content type engine in `Application.onInit()` with `Application.registerContentTypeEngine(XstreamEngine.class)`
51+
- programatically add the content type engine in `Application.onInit()` with `Application.registerContentTypeEngine(XstreamEngine.class)`
5252
- create an [Initializer]({{ site.coreurl }}/src/main/java/ro/pippo/core/Initializer.java) in your project that register the content type engine
5353

5454
For above _XstreamEngine_ we can create an _XstreamInitializer_ with this possible content:

_posts/2015-05-27-guice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class MyApplication extends Application {
4949
}
5050
```
5151

52-
where `GuiceModule` can looks like:
52+
where `GuiceModule` might look like:
5353

5454
```java
5555
public class GuiceModule extends AbstractModule {

_posts/2015-06-18-filters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ GET("/contact.*", (routeContext) {
3939
In above snippet we protected all contact pages. If the current session doesn't contain an attribute `username`
4040
then our filter redirects the request to the `login` page.
4141

42-
Now we want to propose you a most complicated scenario where we are getting a Database instance to be shared
42+
Now for a complicated scenario where we are getting a Database instance to be shared
4343
throughout a request-response cycle:
4444

4545
```java

_posts/2016-08-08-deployment.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
layout: page
3+
title: "Deployment"
4+
category: doc
5+
date: 2016-08-08 09:46:53
6+
order: 201
7+
---
8+
9+
### Packaging
10+
11+
The recommended way to deploy Pippo applications is as a normal executable application with an embedded web server.
12+
13+
In order to create a .zip file consisting of your application and its dependencies, complete the following steps:
14+
15+
* Create a `src/main/assembly/assembly.xml` file with the following content:
16+
17+
```xml
18+
<assembly>
19+
<id>app</id>
20+
<formats>
21+
<format>zip</format>
22+
</formats>
23+
<includeBaseDirectory>false</includeBaseDirectory>
24+
<dependencySets>
25+
<dependencySet>
26+
<useProjectArtifact>false</useProjectArtifact>
27+
<scope>runtime</scope>
28+
<outputDirectory>lib</outputDirectory>
29+
<includes>
30+
<include>*:jar:*</include>
31+
</includes>
32+
</dependencySet>
33+
</dependencySets>
34+
<fileSets>
35+
<fileSet>
36+
<directory>${project.build.directory}</directory>
37+
<outputDirectory>.</outputDirectory>
38+
<includes>
39+
<include>*.jar</include>
40+
</includes>
41+
<excludes>
42+
<exclude>*-javadoc.jar</exclude>
43+
<exclude>*-sources.jar</exclude>
44+
</excludes>
45+
</fileSet>
46+
</fileSets>
47+
</assembly>
48+
```
49+
50+
* Add the following to your `pom.xml` file:
51+
52+
```xml
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<artifactId>maven-assembly-plugin</artifactId>
57+
<version>2.3</version>
58+
<configuration>
59+
<descriptors>
60+
<descriptor>src/main/assembly/assembly.xml</descriptor>
61+
</descriptors>
62+
<appendAssemblyId>false</appendAssemblyId>
63+
</configuration>
64+
<executions>
65+
<execution>
66+
<id>make-assembly</id>
67+
<phase>package</phase>
68+
<goals>
69+
<goal>attached</goal>
70+
</goals>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-jar-plugin</artifactId>
77+
<version>2.3.1</version>
78+
<configuration>
79+
<archive>
80+
<manifest>
81+
<addClasspath>true</addClasspath>
82+
<classpathPrefix>lib/</classpathPrefix>
83+
<mainClass>${main.class}</mainClass>
84+
</manifest>
85+
</archive>
86+
</configuration>
87+
</plugin>
88+
</plugins>
89+
</build>
90+
```
91+
92+
* Add `<main.class>com.path.to.your.MainClass</main.class>` to the `properties` element in your `pom.xml`, replacing the given path with one for the file containing your main method
93+
94+
* Execute `mvn clean package` and view your packaged application at `target/yourappname-#.#.#.zip`
95+
96+
### Deployment
97+
98+
* Transfer the .zip file to your server
99+
* Unzip it
100+
* Execute `java -jar yourappname-#.#.#.jar`
101+
102+
### Snapshot Workaround
103+
104+
If you are using a SNAPSHOT version of Pippo as described in the [Maven section](../dev/maven.html), a small workaround is necessary due to a Maven bug:
105+
106+
* Add `<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>` to the `dependencySet` element inside `assembly.xml`
107+
108+
* Add `<useUniqueVersions>false</useUniqueVersions>` to the maven-jar-plugin's `manifest` section inside `pom.xml`
109+
110+

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We believe in simplicity and we will try to develop this framework with these wo
1616
The core is small (around 140k) and we intend to keep it as small/simple as possible and to push new functionalities in pippo modules and third-party repositories/modules.
1717
You are not forced to use a specific template engine or an embedded web server. Furthermore you have multiple out of the box options (see [Templates](/doc/templates.html) and [Server](/doc/server.html)).
1818

19-
Also, Pippo comes with a very small footprint that makes it excellent for embedded devices (Raspberry PI for example).
19+
Also, Pippo comes with a very small footprint that makes it excellent for embedded devices (Raspberry Pi for example).
2020

2121
The framework is based on Java Servlet 3.0 and requires Java 8.
2222

0 commit comments

Comments
 (0)