summaryrefslogtreecommitdiffstats
path: root/site/branches/site-20060730-mvnbased/src/site/xdoc/projectjava.xml
blob: 35d09424fc281ece2bbc5209a5582b0f6cdb42b8 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.

  Licensed 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.
 -->
 <document url="projectjava">
         <properties>
                <title>Apache Tuscany - Setting up Tuscany Java Project </title>
        </properties>
        <body>
<section name="Tuscany JAVA Project">
<p>
        <ol>

                <li><a href="#System requirements">System requirements</a></li>
                <li><a href="#Enviroment scripts">Environment Scripts- <i>template scripts to setup your environment</i>.</a></li>
                <li><a href="#checkout and build tuscany">Checkout and build Tuscany Java project</a></li>
                <li><a href="#run samples">Running  samples</a></li>
                <li> <script type="text/javascript">linkNewWindow('patches.html','Create and submit a patch');</script></li>
        <li> <script type="text/javascript">linkNewWindow('javadoc/index.htm','javadoc');</script></li>
        <li> <script type="text/javascript">linkNewWindow('codeguidelines.html','Java Coding Guidelines');</script></li>
                <li><a href="#using eclipse">Using Eclipse for IDE</a></li>
                <li><a href="#using idea">Using IDEA style templates</a></li>
                <li><a href="#Logging">Logging</a></li>
        </ol>
</p>
</section>

<a name="System requirements"></a>
<section name="System requirements">
                <p>             
                        Next, please download the following in order to get your machine ready for Java development.
                        <br></br>
                <table style="text-align: left; width: 100%;" border="1"
                                cellpadding="2" cellspacing="2">
                                <tbody>
                                        <tr> <!-- heading -->
                                                <td><b>Software</b></td>
                                                <td><b>Download Link</b></td>
                                <td><b>Download Instructions</b></td>
                                        </tr>
                                        <tr>
                                        <td>JDK 5.0 Update 6 or later</td>
                                        <td>
                                        <script type="text/javascript">linkNewWindow('http://java.sun.com/j2se/1.5.0/download.jsp','jdk 5.0');</script>
                                </td>
                                <td>Steps for Java setup is  <a href="#setup JDK 5.0">here</a>. </td>
                                </tr>
                                <tr> <!--mvn -->
                                        <td> Apache Maven 2.0.4 or later</td>
                                        <td><script type="text/javascript">linkNewWindow('http://maven.apache.org/download.html','Maven 2.04');</script> </td>
                                        <td> 
                                                <ul>
                                                <li>
                                                We are using Maven 2 to build Tuscany, plus a few Ant scripts. Steps for Maven setup is <a href="#setup maven">here</a>.
                                                </li>
                                                <li>
                                                A quick reference on Maven is available <script type="text/javascript">linkNewWindow('maven.html','here');</script>
                                                </li>
                                                </ul>
                                        </td>
                                </tr>
                                <tr> <!--ant -->        
                                        <td> Apache Ant 1.6.5 or later</td>
                                        <td><script type="text/javascript">linkNewWindow('http://ant.apache.org/bindownload.cgi','Ant');</script> </td>
                                        <td> Steps for Ant setup is <a href="#setup ant">here</a>. </td> 
                                </tr>
                                <tr> <!--svn -->
                                        <td>Subversion 1.3.0 or later </td>
                                        <td> <script type="text/javascript">linkNewWindow('http://subversion.tigris.org/project_packages.html','Subversion');</script></td>
                                        <td> 
                                        <ul>
                                                <li>Tuscany source code is stored in a Subversion (SVN) repository, you need Subversion to download it. Steps for svn setup is <a href="#setup subversion">here</a>. </li>
                                                <li> A quick reference for subversion commands is <script type="text/javascript">linkNewWindow('quicksubversion.html','here');</script></li>
                                                <li><i>Note: Some linux distributions may already have a subversion client installed. try executing "svn --version"</i></li>
                                        </ul>
                                        </td>
                                </tr>
                                <tr><!--tomcat --> 
                                <td> Apache Tomcat 5.5.17 </td>
                                <td>
                        <script type="text/javascript">linkNewWindow('http://tomcat.apache.org/','apache tomcat 5.5');</script>
                                </td>
                                <td>
                                This is the Web container that we integrate with, to allow you to use the SCA programming 
                                model in Web applications. 
                                Steps for Tomcat setup is <a href="#setup tomcat">here</a>.
                                </td>
                                </tr>
                                </tbody>
                        </table>
                        <br></br>
                        
</p>
</section><!-- system requirement for development -->


<section name="Creating a tuscany directory">
Open a Command Prompt window, then from the command prompt create a directory named "tuscany": 
This is the directory where we're going to check out the Tuscany code from subversion.
</section>
<section name="Environment scripts">
<p>There is a windows <a href='setenv.bat'>setenv.bat</a> and a linux  <a href='setenv.sh'>setenv.sh</a> script that you can
download by right clicking and "selecting save as..."  You can edit these scripts
 with the below described environment variables to set up your environment any time by running them. On linux you invoke the shell script with
 <pre>
 . ./setenv.sh
 </pre>
</p>
</section>
        <a name="setup JDK 5.0"></a>
<section name="Downloading and installing the Java JDK 5.0"> 
<ul>
        <li>
        Download and extract the appropriate JDK for your operating system from <script type="text/javascript">linkNewWindow('http://java.sun.com/j2se/1.5.0/download.jsp','http://java.sun.com/j2se/1.5.0/download.jsp');</script>.
        </li>
        <li>
         set the JAVA_HOME environment variable to point to the root directory of where you extracted java download.
        </li>
        <li>
         Add to your PATH environment variable to include the full path to the <b>bin</b> subdirectory of the JDK download package.
        </li>
</ul>
</section>

<a name="setup maven"></a>
<a name="setup maven"></a>
<section name ="Downloading and installing Apache Maven">
<ul>
        <li>
        Download and extract Maven 2.0.4 or later from  <script type="text/javascript">linkNewWindow('http://maven.apache.org/download.html','http://maven.apache.org/download.html');</script>.
        </li>
        <li>
         Add to your PATH environment variable to include the  the full path to the  <b>bin</b> subdirectory of the Maven  download package.
        </li>
</ul>
</section>
<a name="setup ant"></a>
<section name ="Downloading and installing Apache Ant">
<ul>
        <li>
        Download and extract Ant 1.6.5  or later from  <script type="text/javascript">linkNewWindow('http://ant.apache.org/bindownload.cgi','http://ant.apache.org/bindownload.cgi');</script>.
        </li>
        <li>
         Add to your PATH environment variable to include the  the full path to the <b>bin</b> subdirectory of the Ant download.
        </li>
</ul>
</section>
<a name="setup subversion"></a>
<section name ="Downloading and installing Subversion">
<ul>
        <li>
        Download and extract Subversion 1.3.1 or later from  <script type="text/javascript">linkNewWindow('http://subversion.tigris.org/project_packages.html','http://subversion.tigris.org/project_packages.html');</script>.
        </li>
        <li>
        Modify your path statement to include  the full path to the subversion <b>bin</b> directory. 
        </li>
        <p><i>Note: For linux you may need to install subversion  as root </i></p>
</ul>
<p> A quick reference for subversion commands is <script type="text/javascript">linkNewWindow('quicksubversion.html','here');</script></p>
</section>

<a name="setup tomcat"></a>
<section name ="Download and Setup Tomcat">
        <ul>
        <li>
        Dowload apache-tomcat-5.5.17  <script type="text/javascript">linkNewWindow('http://mirrors.ibiblio.org/pub/mirrors/apache/tomcat/tomcat-5/v5.5.17/bin/apache-tomcat-5.5.17.zip','apache-tomcat-5.5.17.zip');</script> for Windows or
          <script type="text/javascript">linkNewWindow('http://mirrors.ibiblio.org/pub/mirrors/apache/tomcat/tomcat-5/v5.5.17/bin/apache-tomcat-5.5.17.tar.gz','apache-tomcat-5.5.17.tar.gz');</script> for Linux
        to the <B>tuscany\java\distribution\tomcat-overlay directory</B>. Do not unpack.
        </li>
        </ul>
</section>

<a name="checkout and build tuscany"></a>
<section name ="Checkout and Build Tuscany">
        <p>
                <b>Check out Tuscany Java</b>
        </p>
        <p>     
        From the command prompt, in the <B>tuscany</B> directory do the following: 
        <br></br>
        <code>
        svn co http://svn.apache.org/repos/asf/incubator/tuscany/java
        </code>
        <br></br>
        This should check out all the source code from the Tuscany SVN repository into java sub directory. 
</p>
<p>
</p>
<p>
        <b> Build Tuscany Java </b>
</p>
<p>
        When the check out completes change to the <b>java</b> subdirectory.
        From the command prompt do the following build tuscany using maven:
        <pre>
        mvn 
        </pre>
This will build the Tuscany runtime with Maven. Maven will download all the JAR dependencies, build all the Tuscany sub-projects and run the unit tests. 
</p>
<p>
<i><b>Note:</b> Depending on the load of remote Mavan 2.0 repositories you may have to execute mvn several time until required
      dependencies are all located in your local maven repository.  After you have completed a full successful build you 
      can use "mvn -o" which is much faster.</i>
</p>
</section>
<a name="run samples"></a>
<section name ="Running The Samples">
        <p>Run the samples by building the distribution.</p>
         <ul>
         <li>
          Change the directory to the tuscany\java\distribution
         </li>
         <li>
          Run build-dist.bat (for win32 platforms), or build-dist.sh (for linux)
         </li>
         <li>
          Change the directory tuscany\java\distribution\target\tuscany-dist
         </li>
         <li>
                 
          Follow the directions in <script type="text/javascript">linkNewWindow('samples/java/GettingStarted.htm#Starting the Server','GettingStarted.htm');</script>.
         </li>
         </ul>
           
</section>
<a name="using eclipse"></a>
<section name="Using Eclipse (optional)">
                        <p>
                                <span style="font-size: 10pt;">
                                        Link to Eclipse download :
                                        <span>
                                                <a
                                                        href="http://www.eclipse.org/downloads/index.php">
                                                        http://www.eclipse.org/downloads/index.php
                                                </a>
                                        </span>
                                </span>
                        </p>
                        <p>
                                Getting Started documentation:
                                                <a href="http://www.eclipse.org/downloads/index.php">
                                                        http://www.eclipse.org/downloads/index.php
                                                </a>
                        </p>
                        <p>
                                To create the eclipse projects to use for SCA development:
                        </p>
                        <p>
                                1) When checking code out from subversion, checkout the
                                        subversion trunk to a location outside your eclipse
                                        workspace (it has to be outside because Eclipse will
                                        not allow you to import projects from a location
                                        overlapping with your workspace)
                        </p>
                        <p style="margin-left: 0.5in; text-indent: -0.25in;"><!--[if !supportLists]-->
                                2) Go to Import / Existing projects into workspace.
                                        <span style="" />
                                        Select either the runtime, spec, tools or samples
                                        directory.
                                        <span style="" />
                                        The wizard proposes the list of Eclipse projects
                                        under that directory. Importing the projects does
                                        not copy the files; it just makes the files at that
                                        location visible under an Eclipse project.
                        </p>
                        <p>
                                3) If you need to use Eclipse to edit files outside of
                                        these projects (for example the etc directory, or
                                        the maven files at the root of the trunk), then
                                        delete the Eclipse projects, with the option to not
                                        delete the files, and import the whole trunk as a
                                        project.
                        </p>
                </section>
                <section name="Using Eclipse style templates">
                 If you are using Eclipse, Tuscany has a preferred Java coding style. Please use the 
                   <a href='http://svn.apache.org/repos/asf/incubator/tuscany/java/etc/tuscany-eclipse-codestyle.xml'>tuscany-eclipse-codestyle.xml</a> in Eclipse.
                <br/>Download this file. <i>You may need to right click and save.</i> 
                Then in Eclipse:<br/>
                <pre>
                Window->Preferences-&gt;Java-&gt;Code-Style-&gt;Formatter-&gt;Import...
                <i>(Specify path and file to the tuscany-eclipse-codestyle.xml just downloaded. </i>
                </pre>
                </section>
                <section name="Using Subclipse (optional)">
                        <p>
                                Install the Subversion Eclipse Plugin as described here:
                                <a href="http://subclipse.tigris.org/">http://subclipse.tigris.org/
                                </a>
                        </p>
                        <ol>
                                <li>
                                Open the SVN Repository Exploring perspective
                                </li>
                        
                                <li>
                                Right click in the SVN Repository view.
                                
                                </li>
                                <li>Select "New" and "Repository Location" 
                                
                                </li>
                                <li>
                                Url:
                                        <a href="http://svn.apache.org/repos/asf/incubator/tuscany">
                                        http://svn.apache.org/repos/asf/incubator/tuscany
                                </a>
                                        <p>
                                                Use URL https://svn.apache.org/repos/asf/incubator/tuscany if you
                                                have committer rights and need to commit changes back to the repository.
                                        </p>
                                </li>
                                <li>
                                        Select the "Finish" button and allow Subeclipse time to access the repository and
                                        display its contents in the SVN Repository explorer.  Once the repository is displayed
                                        in the explorer, you will see a number of subfolders displayed.  The ones that are
                                        relevant are "java", "cpp" and "site" - which contain the Tuscany Java runtime, the
                                        Tuscany C++ runtime and the Tuscany website material respectively.
                                </li>
                                <li>
                                        Select the folder you want to check out as a project - one of java, cpp or site for example
                                        Right click, select "Checkout" and "Checkout using new project wizard" - select the appropriate
                                        options for your needs and then click "Finish"
                                </li>
                        </ol>
                        <p>
                                You can check in changes using the "Commit" item in the team submenu of the Java perspective.
                        </p>
                </section>
<a name="using idea"></a>
                <section name="Using IDEA style templates">
                 If you are using IDEA IDE, Tuscany has a preferred Java coding style. Please use the 
                   <a href='http://svn.apache.org/repos/asf/incubator/tuscany/java/etc/tuscany-idea-codestyle.xml'>tuscany-idea-codestyle.xml</a> in IDEA 
                <br/>Download this file. <i>You may need to right click and save.</i> 
                        <pre>
                        copy tuscany-idea-codestyle.xml to ~/.IntelliJIdea50/config/codestyles
                        File-&gt;Settings, Project Code Styles, Import
                        </pre>
                </section>
<a name="Logging"></a>
                <section name="Logging">
                For more information regarding how to add logging to your code you can review 
                 <script type="text/javascript">linkNewWindow('monitoring.htm','Tuscany Monitoring');</script>
                </section>
        </body>
</document>