/* * 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. */ /* $Id$ */ package org.apache.fop.render.ps; import org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D; import org.apache.xmlgraphics.java2d.ps.PSDocumentGraphics2D; /** * This class enables to transcode an input to a PostScript document. * *

Two transcoding hints (KEY_WIDTH and * KEY_HEIGHT) can be used to respectively specify the image * width and the image height. If only one of these keys is specified, * the transcoder preserves the aspect ratio of the original image. * *

The KEY_BACKGROUND_COLOR defines the background color * to use for opaque image formats, or the background color that may * be used for image formats that support alpha channel. * *

The KEY_AOI represents the area of interest to paint * in device space. * *

Three additional transcoding hints that act on the SVG * processor can be specified: * *

KEY_LANGUAGE to set the default language to use (may be * used by a <switch> SVG element for example), * KEY_USER_STYLESHEET_URI to fix the URI of a user * stylesheet, and KEY_PIXEL_TO_MM to specify the pixel to * millimeter conversion factor. * * @author Keiron Liddle * @version $Id$ */ public class PSTranscoder extends AbstractPSTranscoder { /** * Constructs a new PSTranscoder. */ public PSTranscoder() { super(); } /** @see AbstractPSTranscoder#createDocumentGraphics2D() */ protected AbstractPSDocumentGraphics2D createDocumentGraphics2D() { return new PSDocumentGraphics2D(false); } } ue='chore-readme-8-14-4'>chore-readme-8-14-4 Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/frameworkwww-data
aboutsummaryrefslogtreecommitdiffstats

path: root/documentation/getting-started/getting-started-maven.asciidoc
blob: aca26b8115afcac77469c5bf3ab1808c7149f74b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
title: Creating a Project with Maven
order: 200
layout: page
---

[[getting-started.maven]]
= Creating a Project with Maven

((("Maven", "creating a project", id="term.maven.creating", range="startofrange")))

In previous sections, we looked into creating a Vaadin Maven project in different IDEs.
In this section, we look how to create such a project on command-line.
You can then import such a project in your IDE.

In addition to regular Maven, you can use any Maven-compatible build or
dependency management system, such as Ivy or Gradle. For Gradle, see the
link:https://github.com/johndevs/gradle-vaadin-plugin[Gradle Vaadin Plugin].
Vaadin Plugin for Eclipse uses Ivy for resolving dependencies in Vaadin
projects, and it should provide you with the basic Ivy configuration.

For an interactive guide, see the instructions at link:https://vaadin.com/maven[vaadin.com/maven].
It automatically generates you the command to create a new project based on archetype selection.
It can also generate dependency declarations for Vaadin dependencies.

[[getting-started.maven.command-line]]
== Working from Command-Line

You can create a new Maven project with the following command (given in one
line):

[subs="normal"]
----
[prompt]#$# [command]#mvn# archetype:generate \
   -DarchetypeGroupId=com.vaadin \
   -DarchetypeArtifactId=[replaceable]#vaadin-archetype-application# \
   -DarchetypeVersion=[replaceable]#8.x.x# \
   -DgroupId=[replaceable]#com.pany# \
   -DartifactId=[replaceable]#project-name# \
   -Dversion=[replaceable]#0.1# \
   -Dpackaging=war
----
The parameters are as follows:

[parameter]#archetypeGroupId#:: The group ID of the archetype is [literal]#++com.vaadin++# for Vaadin
archetypes.

[parameter]#archetypeArtifactId#:: The archetype ID.
See the list of available archetypes in <<dummy/../../../framework/getting-started-archetypes#getting-started.archetypes,"Overview of Maven Archetypes">>.

[parameter]#archetypeVersion#::
Version of the archetype to use.
This should be [literal]#++LATEST++# for normal Vaadin releases.
For prerelease versions it should be the exact version number, such as [literal]#++7.6.4++#.

[parameter]#groupId#:: A Maven group ID for your project. It is normally your organization domain name
in reverse order, such as com.example. The group ID is also used as a prefix for
the Java package in the sources, so it should be Java compatible - only
alphanumerics and an underscore.

[parameter]#artifactId#:: Identifier of the artifact, that is, your project. The identifier may contain
alphanumerics, minus, and underscore. It is appended to the group ID to obtain
the Java package name for the sources. For example, if the group ID is
com.example and artifact ID is myproject, the project sources would be placed in
com.example.myproject package.

[parameter]#version#:: Initial version number of your application. The number must obey the Maven
version numbering format.

[parameter]#packaging#:: How will the project be packaged. It is normally [literal]#++war++#.



Creating a project can take a while as Maven fetches all the dependencies. The
created project structure is shown in
<<figure.getting-started.maven.archetype.created>>.

[[figure.getting-started.maven.archetype.created]]
.A New Vaadin Project with Maven
image::img/maven-project-created.png[scaledwidth=60%]


[[getting-started.maven.compiling]]
== Compiling and Running the Application

((("Maven", "compiling", id="term.maven.compiling", range="startofrange")))


Before the application can be deployed, it must be compiled and packaged as a
WAR package. You can do this with the [literal]#++package++# goal as follows:

[subs="normal"]
----
[prompt]#$# [command]#mvn# package
----
The location of the resulting WAR package should be displayed in the command
output. You can then deploy it to your favorite application server.

The easiest way to run Vaadin applications with Maven is to use the light-weight Jetty web server.
After compiling the package, all you need to do is type:

[subs="normal"]
----
[prompt]#$# [command]#mvn# jetty:run
----

The special goal starts the Jetty server in port 8080 and deploys the
application. You can then open it in a web browser at
http://localhost:8080/project-name.

(((range="endofrange", startref="term.maven.compiling")))

[[getting-started.maven.addons]]
== Using Add-ons

((("Maven", "using add-ons", id="term.maven.addons", range="startofrange")))

If you use Vaadin add-ons from the http://vaadin.com/directory[Vaadin Directory], you need to add them as dependencies in the project POM.
The instructions are given in <<dummy/../../../framework/addons/addons-maven#addons.maven, "Using Add-ons in a
Maven Project">>.

_In projects that use Vaadin 7.6 or older_, you need to compile the widget set manually.
See the add-on usage instructions.

(((range="endofrange", startref="term.maven.addons")))
(((range="endofrange", startref="term.maven.creating")))