Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 102b35d

Browse files
author
jvanzyl
committed
o making a new site for the migration
0 parents  commit 102b35d

File tree

128 files changed

+9686
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+9686
-0
lines changed

README.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
1) To deploy plexus-site module using dav, follow the instructions below:
3+
4+
http://docs.codehaus.org/display/HAUSMATES/Maven+Guide
5+
6+
2) Actually use last snapshot of doxia-book (format pdf failed on windows)
7+
8+
3) Use "mvn site-deploy" to publish the content.
9+
10+

apt-old/appserver.apt

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
-----
2+
Developing Plexus Applications
3+
-----
4+
Trygve Laugstol
5+
-----
6+
7+
<<This is an old piece of documentation, yet to be integrated into the new site and removed>>
8+
9+
Developing Plexus Application
10+
11+
This document documents how we recomend you organize your source code and artifacts while
12+
developing Plexus applications.
13+
14+
The example application
15+
16+
This document uses Continuum as a example application. Continuum has a core, a set of
17+
builders and a set of views. Each builder is support for a specific build system
18+
(Maven, Ant, etc) and each view is a external interface to the core (web, xml-rpc, etc).
19+
20+
The layout looks like this:
21+
22+
+----------------------------------------+
23+
/continuum-core
24+
/continuum-builders
25+
/continuum-builder-maven-2
26+
/continuum-builder-ant
27+
/continuum-views
28+
/continuum-view-web
29+
/continuum-view-xml-rpc
30+
/continuum-plexus-application
31+
+----------------------------------------+
32+
33+
All of the Continuum artifacts exept the <<<continuum-plexus-application>>> is not related to
34+
the Plexus application at all and makes Continuum perfectly embedable in any other way (like
35+
just using the Embedder in a custom enviroment).
36+
37+
The <<<continuum-plexus-application>>> artifact will in addition to any classes in
38+
<<<src/main/java>>> contain the Plexus configuration files and application descriptor files
39+
40+
How to work with Plexus applications on a day-to-day basis
41+
42+
Plexus applications is run in Plexus runtimes. A application is deployed to a runtime by
43+
copying the JAR into the <<<apps>>> directory of the runtime. The runtime will automatically
44+
deploy any applications in <<<apps>>>. In the Plexus Maven plugin there are some useful goals
45+
while developing applications:
46+
47+
[<<<plexus:runtime>>>] generates a Plexus runtime into <<<target/plexus-runtime>>>. The
48+
generated runtime will be ready to use instantly.
49+
50+
[<<<plexus:application>>>] assembles the application in <<<target/plexus-application>>>. The
51+
application is not packaged yet so if it's wanted to do some post processing before
52+
packaging the application is can be done as a post goal to <<<plexus:app>>>
53+
54+
[<<<plexus:package-application>>>] makes a JAR file containing the Plexus configuration
55+
files, the application descriptor and classes from <<<continuum-plexus-application>>> only.
56+
It does not contain all the dependencies of the application.
57+
58+
[<<<plexus:package-app-with-dependencies>>>] has a prerequisite on <<<plexus:package-app>>>
59+
and will take the application JAR and all of it's dependencies and package it in a new
60+
artifact called <<<continuum-plexus-application-alldeps-<version>.jar>>>. The JAR that this
61+
goal generates will be completly standalone in the way that it can be taken and deployed in
62+
any Plexus runtime without worrying about missing dependencies.
63+
64+
[<<<plexus:deploy-dev-application>>>] has prerequisite on <<<plexus:package-app>>> and will
65+
deploy the application JAR to the <<<apps>>> directory in the runtime. It will also copy over
66+
all the dependencies into the <<<repository>>> directory.
67+
68+
-------
69+
70+
This is a suggestion for layout for how the application server and the application layouts, both in source and jar forms
71+
72+
h2. The Application Server Directory Layout
73+
74+
||Directory||Description||
75+
|{{bin}}|Same as always, contains startup scripts|
76+
|{{conf}}|Contains {{plexus.xml}} which is the configuration for the application server and {{classworlds.conf}} which will be used for bootstrapping the application server.|
77+
|{{core}}|Contains the plexus-container-default and plexus-appserver and their dependencies.|
78+
|{{lib}}|This directory would initially be empty. It can contain artifacts thats configured as services {{conf/plexus.xml}} |
79+
|{{apps}}|All jar files in this directory will be exploded and started as plexus applications.|
80+
|{{services}}|Services such as a Jetty service, or TX service. Not sure how these should be packaged. They could be a contained jar, or more likely follow the Application Directory Layout outlined below. The later case would be good so the configuration files could be edited.|
81+
82+
h2. The Application Directory Layout
83+
84+
||Directory||Description||
85+
|{{conf}}|Contains {{plexus.xml}} that is a normal plexus configuration file. It contains application specific components.|
86+
|{{lib}}|Contains all jar files in the application|
+248
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
-----
2+
Plexus Applications and Runtimes
3+
-----
4+
Trygve Laugstol
5+
Emmanuel Venisse
6+
-----
7+
8+
Building Plexus Applications and Runtimes
9+
10+
To be able to build Plexus applications and runtimes you'll need:
11+
12+
* The Plexus mojo
13+
14+
* The Plexus application archetype
15+
16+
* The Plexus runtime archetype
17+
18+
<<<TODO: Make a link to the maven site that explains what a archetype is.>>>
19+
20+
Introduction
21+
22+
Some stub directories will be created:
23+
24+
[<<</my-component>>>] - Here we'll make a Plexus component
25+
26+
[<<</my-application>>>] - Here we'll make an application
27+
28+
[<<</my-runtime>>>] - Here we'll make a runtime that will host your
29+
application. This runtime will contain startup scripts for Unix, Windows and
30+
OS X and will be completly standalone.
31+
32+
Creating a Simple Plexus Component
33+
34+
* Making the Component Stub
35+
36+
+-----------------------------------------------------------------------------+
37+
$ mvn archetype:create \
38+
-DarchetypeGroupId=org.codehaus.plexus \
39+
-DarchetypeArtifactId=plexus-archetype-component-simple \
40+
-DarchetypeVersion=1.0-alpha-1-SNAPSHOT \
41+
-DgroupId=mygroup \
42+
-DartifactId=my-component \
43+
-Dversion=1.0-SNAPSHOT \
44+
-Dpackage=my.component
45+
+-----------------------------------------------------------------------------+
46+
47+
* Building the Plexus Component
48+
49+
To build the component simply type in <<</my-component>>>:
50+
51+
+-----------------------------------------------------------------------------+
52+
$ mvn install
53+
+-----------------------------------------------------------------------------+
54+
55+
You should now have a packaged Plexus component in <<<target/my-component-1.0-SNAPSHOT.jar>>>
56+
57+
Creating a Simple Plexus Application
58+
59+
* Making the Application Stub
60+
61+
+-----------------------------------------------------------------------------+
62+
$ mvn archetype:create \
63+
-DarchetypeGroupId=org.codehaus.plexus \
64+
-DarchetypeArtifactId=plexus-archetype-application \
65+
-DarchetypeVersion=1.0-alpha-1-SNAPSHOT \
66+
-DgroupId=mygroup \
67+
-DartifactId=my-application \
68+
-Dversion=1.0-SNAPSHOT \
69+
-Dpackage=my.app
70+
+-----------------------------------------------------------------------------+
71+
72+
* Adding the Plexus Component dependency
73+
74+
You need to add the following dependency in <<</my-application>>> pom:
75+
76+
+-----------------------------------------------------------------------------+
77+
<dependency>
78+
<groupId>mygroup</groupId>
79+
<artifactId>my-component</artifactId>
80+
<version>1.0-SNAPSHOT</version>
81+
</dependency>
82+
+-----------------------------------------------------------------------------+
83+
84+
and in <<<src/conf/application.xml>>>, add this so the Plexus component will be
85+
loaded at startup:
86+
87+
+-----------------------------------------------------------------------------+
88+
<load-on-start>
89+
<component>
90+
<role>mygroup.HelloWorld</role>
91+
</component>
92+
</load-on-start>
93+
+-----------------------------------------------------------------------------+
94+
95+
* Building the Plexus Application
96+
97+
To build the application simply type in <<</my-application>>>:
98+
99+
+-----------------------------------------------------------------------------+
100+
$ mvn plexus-appserver:assemble-app
101+
+-----------------------------------------------------------------------------+
102+
103+
and you should have a application in <<<target/plexus-application>>>. Inside
104+
the exploded application there will be two directories: <<<conf>>> and
105+
<<<lib>>>. The <<<conf>>> directory contains the configuration file for your
106+
application and <<<lib>>> contains all the dependencies the application has.
107+
108+
If you want to do some extra processing on these files or possibly add your
109+
own files you can have a plugin with a post goal on <<<plexus:app>>> and it
110+
would be invoked before the application was packaged.
111+
112+
If you now run the <<<plexus-appserver:package-app>>> goal:
113+
114+
+-----------------------------------------------------------------------------+
115+
$ mvn plexus-appserver:package-app
116+
+-----------------------------------------------------------------------------+
117+
118+
the resulting JAR file will be ready for deployment in a Plexus runtime. Our
119+
example application JAR will be
120+
<<<target/my-application-1.0-SNAPSHOT.jar>>>.
121+
122+
you can run the above commands in one:
123+
124+
+-----------------------------------------------------------------------------+
125+
$ mvn install
126+
+-----------------------------------------------------------------------------+
127+
128+
Creating the Runtime
129+
130+
* Making the Runtime Stub
131+
132+
Creating the stub runtime is as easy as creating the application:
133+
134+
+-----------------------------------------------------------------------------+
135+
$ mvn archetype:create \
136+
-DarchetypeGroupId=org.codehaus.plexus \
137+
-DarchetypeArtifactId=plexus-archetype-runtime \
138+
-DarchetypeVersion=1.0-alpha-1-SNAPSHOT \
139+
-DgroupId=mygroup \
140+
-DartifactId=my-runtime \
141+
-Dversion=1.0-SNAPSHOT \
142+
-Dpackage=my.runtime
143+
+-----------------------------------------------------------------------------+
144+
145+
* Building the Runtime
146+
147+
+-----------------------------------------------------------------------------+
148+
$ mvn package
149+
+-----------------------------------------------------------------------------+
150+
151+
You should now have a usable runtime in <<<target/plexus-runtime>>> and a
152+
packaged runtime in <<<target/my-runtime-1.0-SNAPSHOT.jar>>>. Now lets copy
153+
over the application:
154+
155+
+-----------------------------------------------------------------------------+
156+
$ cp ../my-application/target/my-application-1.0-SNAPSHOT.jar \
157+
target/plexus-app-runtime/apps
158+
+-----------------------------------------------------------------------------+
159+
160+
You can also add a dependency on my-application in the my-runtime pom, so it won't
161+
be necessary to copy the application manually in the runtime.
162+
163+
+-----------------------------------------------------------------------------+
164+
<dependency>
165+
<groupId>mygroup</groupId>
166+
<artifactId>my-application</artifactId>
167+
<version>1.0-SNAPSHOT</version>
168+
<type>plexus-application</type>
169+
</dependency>
170+
+-----------------------------------------------------------------------------+
171+
172+
Now you have a working Plexus runtime with your application installed. To
173+
start it run:
174+
175+
+-----------------------------------------------------------------------------+
176+
$ sh target/plexus-app-runtime/bin/plexus.sh
177+
+-----------------------------------------------------------------------------+
178+
179+
Hopefully you should now have a runtime running with. The message "Starting Hello Component."
180+
sended by <<<my-component>>> at startup must appears in logs.
181+
182+
Getting fancy: Adding a Shared Servlet Container
183+
184+
Plexus runtimes can have a set of services thats shared between the applications.
185+
One very useful service is a servlet container. This enables several isolated applications
186+
to share the same Jetty instance without the need for complicated Apache HTTPD proxy
187+
setups. The servlet container service will all the web in a configured
188+
directory. The application contains a commented out configuration section for
189+
the servlet container which you must uncomment so the service would be
190+
enabled.
191+
192+
<<<NOTE: This example assumes that you have the runtime that was created in the last section.>>>
193+
194+
First add the service dependency into the runtime:
195+
196+
+-----------------------------------------------------------------------------+
197+
<dependency>
198+
<groupId>org.codehaus.plexus</groupId>
199+
<artifactId>plexus-appserver-service-jetty</artifactId>
200+
<version>2.0-alpha-1</version>
201+
<type>plexus-service</type>
202+
</dependency>
203+
+-----------------------------------------------------------------------------+
204+
205+
Now we need to add a web application to the application. As a simple web
206+
application we're using the Jetty JavaDocs. Add this in <<<my-application>>> pom:
207+
208+
+-----------------------------------------------------------------------------+
209+
<dependency>
210+
<groupId>jetty</groupId>
211+
<artifactId>javadoc</artifactId>
212+
<version>4.2.23RC0</version>
213+
<type>war</type>
214+
</dependency>
215+
+-----------------------------------------------------------------------------+
216+
217+
Now we need to configure the servlet container service so it knows where to
218+
find the web applications. In <<<src/conf/application.xml>>> uncomment the servlet
219+
container section. Now bundle the application again:
220+
221+
+-----------------------------------------------------------------------------+
222+
$ mvn install
223+
+-----------------------------------------------------------------------------+
224+
225+
We suppose there you added <<<my-application>>> dependency in <<<my-runtime>>> pom.
226+
Execute this commands from <<</my-runtime>>>
227+
228+
+-----------------------------------------------------------------------------+
229+
$ mvn package
230+
+-----------------------------------------------------------------------------+
231+
232+
Now when the application server is started again it should
233+
234+
* Deploy the servlet container.
235+
236+
* Boot Jetty.
237+
238+
* Deploy the application.
239+
240+
* The servlet container will detect that a new application was deployed and deploy the JavaDoc WAR.
241+
242+
So lets start it:
243+
244+
+-----------------------------------------------------------------------------+
245+
$ sh target/plexus-app-runtime/bin/plexus.sh
246+
+-----------------------------------------------------------------------------+
247+
248+
And open your browser to http://localhost:8080/

0 commit comments

Comments
 (0)