Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

This

...

document

...

is

...

the

...

development

...

guideline

...

for

...

SCA

...

Java

...

2.x project.

...

OSGi Overview and Approach

OSGI & Tuscany

Anchor
General Guide
General Guide
General Guide

Welcome to the Tuscany SCA Java subproject project. We look forward to your participation and try to help you get on board. Feel free to ask your questions on the mailing list.

Here are some general guidelines we use in this project.

  • Java SCA sub-project aims to provide enterprise-grade service infrastructure based on SCA.
  • Tuscany SCA is not just a reference implementation. We encourage innovation based on the tenets of SCA. A lot of work we do provides feedback to the specifications.
  • The Java SCA infrastructure should provide flexibility and choice. It should not dictate programming models but support many.
  • The Java SCA infrastructure is very modularized and is designed to be highly extensible so users can customize it to fit their needs.

Anchor
Prerequisites
Prerequisites
Prerequisites

Java SCA requires the following:

Checking out code from Subversion

Use the command as follows:

Code Block

svn checkout https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/

Anchor
Setup
Setup
Setting up your Development Environment

top-down build (recommended approach)

Check out all of the java source code.

Code Block

svn checkout https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/

Building the SCA source code :

Code Block

cd trunk
mvn -fae clean install

It should work even if you start with an empty Maven local repository, and it should always work, however when you are building for Tuscany for the first time there are a lot of dependencies which must be downloaded so the first build can take a long time and it may fail with problems retrieving the dependencies.

(lightbulb) There can be occasional problems downloading artifacts from remote Maven repositories so if mvn fails with network related sounding messages sometimes just trying again can fix the problem.

(lightbulb) The trunk code sometimes has SNAPSHOT dependencies which can get out of date in your local repository so if you see odd build failures try updating the SNAPSHOT jars by using the "-U" parameter in the mvn command.

(lightbulb) Once you have done a top-down build, and your local maven repository is populated, you can start using the maven off line option to speed up the build process by using the "-o" parameter in the mvn command.

Info

The SCA build consumes a good amount of memory, in case you are seeing issues during the build, set a MAVEN_OPTS environment variable to allocate more memory for the build process.

Windows : SET MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m"
Unix : export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m"

Info

If you are using MAC OS, please see 'Special instructions for MAC OS users' section below

Anchor
IDE
IDE
Importing SCA modules into your Development IDE

Using Eclipse

If this is the first time you are using your workspace with maven m2 local repository, you will need to tell your Eclipse workspace the location of the directory, and you can do this with the following command :

Code Block

mvn -Declipse.workspace=[path-to-eclipse-workspace] eclipse:add-maven-repo

In order to generate the necessary project files to import the SCA modules to Eclipse, you can use the maven eclipse plugin

Code Block

mvn eclipse:eclipse

Now launch your Eclipse IDE, select File->Import->Existing projects into Workplace, and then import the project from SCA Modules into your Eclipse Workspace.

Using Eclipse PDE

To help with development in an OSGi environment Tuscany also has a build profile to setup the Eclipse Plugin Development Environment:

Code Block

mvn -fae -Peclipse

Now set the "Target Platform" in your Eclipse IDE by following the steps below :

  • Inside eclipse, select File->Open File" and open "distribution/all/target/features/tuscany.target"
    • click "Set as target platform" on the upper-right side of the overview window that opened

Then as when using eclipse:eclipse launch your Eclipse IDE, select File->Import->Existing projects into Workplace, and then import the project from SCA Modules into your Eclipse Workspace.

There are also some Tuscany Eclipse code templates available:
Eclipse Style Formatter
Eclipse Templates

Anchor
Eclipse Build Troubleshooting
Eclipse Build Troubleshooting
Eclipse Build Troubleshooting

Sometimes a Maven build will work from the command line, yet the same component will not build in the Eclipse environment. Of course, developers try to prevent this from happening, but it does happen and makes for a valid Jira. In the meantime, here are some steps that might help correct build issues in the Eclipse environment:

  • Missing classpath variables - Sometimes Java build classpath variables are incorrect or missing, for instance "Unbound classpath variable: 'M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar'". Add the classpath variable 'M2_REPOS' to your workspace. Window > Preferences > Java > Build Path > Classpath variables. Create variables for any missing variables and point them to the appropriate place in your file system. Do a complete rebuild.
  • Missing projects - Sometimes developers add or remove project dependencies. These show up with error message "The project cannot be built until build path errors are resolved". This is often a sign that your Eclipse workspace is out of sync with your local repository or the svn repository. The full remedy is to refresh your local repos (svn update), rebuild your local repos (mvn clean install -U), regenerate Eclipse projects (mvn -Declipse), reimport projects in Eclipse, and clean/rebuild your projects. You may be able to do less than this full refresh with simple changes, but the full refresh is often needed for major changes.
  • Project won't build - Sometimes a particular project will not build despite repeated efforts. Consider if this project is necessary to the task at hand. You may be able to delete the problematic Eclipse project and continue with other work.

Anchor
MacOS
MacOS
Special instructions for MAC OS users

Some plugins used in the Tuscany build requires a explicit dependency on some classes from JDK tools.jar, which is in a different place in the MAC OS environment.

We have created duplicate profiles in Tuscany to accommodate the most used user tasks

  • Running a build : there is a default profile for the mac environment properly configuring the tools.jar property
    Code Block
    
       mvn clean install
    
  • Creating Eclipse IDE project files : there is a "eclipse-mac" profile
    Code Block
    
       mvn -Peclipse-mac
    

Update your maven settings.xml (%user_home%/.m2/settings.xml)

Updating your settings.xml with proper property configuration will make all profiles work in a MAC OS environment.

Code Block

<settings>

  <profiles>
     <profile>
        <id>mac-os-configuration</id>
        <properties>
           <tools.jar>${java.home}/../Classes/classes.jar</tools.jar>
        </properties>
     </profile>
  </profiles>
  
  <activeProfiles>
    <activeProfile>mac-os-configuration</activeProfile>
  </activeProfiles>

</settings>

Anchor
Coding Guidelines
Coding Guidelines
Coding Guidelines

There are a few simple guidelines when developing for JAVA SCA:

  • The basic coding style used is the described at Sun Java coding standards but the main thing is to be consistent with the existing code you're updating, so for example, if you're updating a method that uses the braces on the same line style don't add code with the hanging braces style.
  • Always include the Apache License Headers on all files (both source code files and resource files such as xml documents)
  • Include a descriptive log message for checkins, for example "fixed such and such problem".

While Tuscany does not yet have an official style or template, here are some templates that folks have been using and have been checked into the build which are stored at https://svn.apache.org/repos/asf/tuscany/java/etc/

Naming conventions to increase consistency

Folder Names: Please use all lowercases and dashes in folder names (like in the jar names)

  • Maven artifact id = tuscany-<folder name>

Package names: Package names within modules should include the module name so that source code can be located in the source tree easily. So, for example, java/sca/module/implementation-java would be in package structure org.apache.tuscany.implementation.java.*

Anchor
Testing
Testing
Testing

Tuscany uses plain junit test cases to perform unit and integration testing, below is an example that can also be used as a template for writing new test cases; it demonstrates how to bootstrap the Tuscany SCA runtime in your test case, and because they are based on junit, you can run it from your IDE of choice or from Maven.

Info

Note that we are using JUnit 4.2 code style in OSGI development stream

Code Block

/**
 * Description of your test case and necessary details you find necessary
 */
@Scope("COMPOSITE") @EagerInit
public class CalculatorTestCase {

    private static CalculatorService calculatorService;
    private static NodeLauncher launcher;
    private static Node node;

    @Reference
    public void setCalculatorService(CalculatorService calculatorService) {
        CalculatorTestCase.calculatorService = calculatorService;
    }
    
    
    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        launcher = NodeLauncher.newInstance();
        String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
        node = launcher.createNode("Calculator.composite", new Contribution("test", location));
        System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
        node.start();
    }

    @AfterClass
    public static void tearDownAfterClass() throws Exception {
        if (node != null) {
            node.stop();
            node.destroy();
        }
        if (launcher != null) {
            launcher.destroy();
        }
    }

    @Test
    public void testCalculator() throws Exception {
        // Calculate
        assertEquals(calculatorService.add(3, 2), 5.0);
        assertEquals(calculatorService.subtract(3, 2), 1.0);
        assertEquals(calculatorService.multiply(3, 2), 6.0);
        assertEquals(calculatorService.divide(3, 2), 1.5);
    }
}

(lightbulb) Note that we use surefire maven plugin to run the unit and integration tests, and in most cases, they are configured to match a **/*TestCase.java file name pattern. Because of this, if your test case has a different file name pattern, you might execute it from your IDE of choice, but the maven build won't execute the test.

Anchor
Client Applications
Client Applications
Client Applications as SCA Components

Below is how you can build client applications as an SCA component.

Code Block

@Scope("COMPOSITE") @EagerInit
public class CalculatorClient {
    
    private CalculatorService calculatorService;

    @Reference
    public void setCalculatorService(CalculatorService calculatorService) {
        this.calculatorService = calculatorService;
    }
    
    @Init
    public void calculate() {

        // Calculate
        System.out.println("SCA API ClassLoader: " + print(Reference.class.getClassLoader()));
        System.out.println("3 + 2=" + calculatorService.add(3, 2));
        System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
        System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
        System.out.println("3 / 2=" + calculatorService.divide(3, 2));
    }
    
    private static String print(ClassLoader cl) {
        StringBuffer buf = new StringBuffer();
        for (; cl != null;) {
            buf.append(cl.toString());
            buf.append(' ');
            cl = cl.getParent();
        }
        return buf.toString();
    }

}

Anchor
Maven Build Structure
Maven Build Structure
Maven Build Structure

We use the term Module to refer to the leaf of maven tree.

  • sca/pom.xml's parent will be pom/parent/pom.xml
  • Other poms will use the pom from the parent folder as parent pom
  • Group id: org.apache.tuscany.sca
  • Version of our modules will be specified once in java/sca/pom.xml, child poms don't need specify a version as they get it from their parent
  • pom names begin Apache Tuscany SCA
  • Eclipse projects are generated for all built modules using mvn eclipse:eclipse

Adding a new module and not ready to integrate?

'work-in-progress' modules can be worked on in the same source tree and yet not break the top-down build. You can do this by not listing your module(s) in java/sca/modules/pom.xml.

Development Hints

Anchor
Samples in Eclipse
Samples in Eclipse
Importing existing Tuscany SCA projects into Eclipse

This section has talked about how to get set up ready to develop Tuscany. If you need to import existing samples into Eclipse to work on there are some instructions here. These are instructions for 1.x but should work OK on 2.x.

Anchor
Webapp in Eclipse
Webapp in Eclipse
Generating Eclipse WTP Web Projects for Webapp samples

If you're using Eclipse WTP and want to get WTP Web Projects generated
for our Webapp samples you can simply pass a -Dwtpversion=1.5 option to
the usual mvn eclipse:eclipse command, like this:
mvn -Dwtpversion=1.5 -Peclipse eclipse:eclipse

The magic -Dwtpversion=1.5 option will add the WTP Web project nature to
all the Eclipse projects with <packaging>war</packaging> in their Maven
pom.xml. You'll then be able to add these projects to a WTP Tomcat or
Geronimo Server configuration, to publish and run them straight from
your Eclipse workspace.

Anchor
Ant
Ant
Generating Dependencies for Ant in Samples

Figuring out the package dependency to include in Ant build.xml can be a pain. Here is a quick
script which works in Linux environment for war files.

Code Block
 Guide|#General Guide]
* [Getting Source code|#Getting Source]
* [Setting up your development environment|#Setup]
* [Building the binary and source distributions|#Distributions]
* [Importing SCA modules into your Development IDE|#IDE]
* [Understanding SCA Code Path|#Code Path]
* [Coding Guidelines|#Coding Guidelines]
* [Testing|#Testing]
* [Maven Build Structure|#Maven Build Structure]
* [Reporting Issues and Providing patches|#Providing patches]
* *Development Hints*
** [Generating Eclipse WTP Web Projects for Webapp samples|#Webapp in Eclipse]
** [Generating Dependencies for Ant in Samples|#Ant]
* [How to do a release of Tuscany? |#Release Checklist]
* [Logging, Tracing, and Timing in Tuscany|http://cwiki.apache.org/confluence/display/TUSCANY/Logging%2C+Tracing%2C+and+Timing+in+Tuscany]

\\
&nbsp;

h3. {anchor:General Guide} General Guide

Welcome to the Tuscany SCA Java subproject project. We look forward to your participation and try to help you get on board. Feel free to ask your questions on the mailing list.

Here are some general guidelines we use in this project.
* Java SCA sub-project aims to provide enterprise-grade service infrastructure based on SCA.
* Tuscany SCA is not just a reference implementation. We encourage innovation based on the tenets of SCA. A lot of work we do provides feedback to the specifications.
* The Java SCA infrastructure should provide flexibility and choice. It should not dictate programming models but support many.
* The Java SCA infrastructure is very modularized and is designed to be highly extensible so users can customize it to fit their needs.


h3. {anchor:Prerequisites} Prerequisites

Java SCA requires the following:
* [JDK 5.0\+ (J2SE 1.5.0+)|http://java.sun.com/j2se/1.5.0]
* [Apache Maven (2.0.7+)|http://maven.apache.org/]
* [Subversion (1.2+)|http://subversion.tigris.org/] or [TortoiseSVN (1.4.x+)|http://tortoisesvn.tigris.org/]

h3. {anchor:Getting Source} Getting Source code

The Java SCA project Subversion repository is located at [https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/sca].
The repository can also be viewed online at [http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/]

Anyone can check code out of Subversion. You only need to specify a username and password in order to update the Subversion repository, and only Tuscany committers have the permissions to do so.

h4. Checking out code from Subversion

Use the command as follows (note that it uses http scheme so if you're a committer change it to https):
{code}
svn checkout http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/sca
{code}

h4. Committing Changes to Subversion

Any Tuscany committer should have a shell account on svn.apache.org. Before you can commit, you'll need to set a Subversion password for yourself. To do that, log in to svn.apache.org and run the command svnpasswd.

Tuscany committers should configure these properties in the svn per-user config. On Unix-like systems, this area appears as a directory named .subversion in the user's home directory. On Win32 systems, Subversion creates a folder named Subversion, typically inside the Application Data area of the user's profile directory (C:\Documents and Settings\<user name>\Application Data\Subversion, which, by the way, is usually a hidden directory). 

Please make sure the following properties are set in the "config" file:

{code}
[miscellany]
...
enable-auto-props = yes

[auto-props]
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match will be applied to the file.
### Note that auto-props functionality must be enabled, which
### is typically done by setting the 'enable-auto-props' option.

*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
*.dsp = svn:eol-style=CRLF
*.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=native

*.java = svn:eol-style=native;svn:keywords=Rev Date
*.xml = svn:eol-style=native;svn:keywords=Rev Date
*.xsd = svn:eol-style=native;svn:keywords=Rev Date
*.html = svn:eol-style=native;svn:keywords=Rev Date
*.properties = svn:eol-style=native;svn:keywords=Rev Date
*.jelly = svn:eol-style=native;svn:keywords=Rev Date
*.ipr = svn:eol-style=native
*.iml = svn:eol-style=native
{code}

Once your password is set, you can use a command like this to commit:
{code}
svn commit
{code}
If Subversion can't figure out your username, you can tell it explicitly:
{code}
svn --username <name> commit
{code}
Subversion will prompt you for a password, and once you've entered it, it will remember it for you. Note this is the password you configured with svnpasswd not your shell or other password.

h3. {anchor:Setup} Setting up your Development Environment


h4. Build tree structure

The build tree is designed to facilitate modular development and releases. Maven modules are grouped by how they are released under an hierarchy. Java SCA currently have the below module hierarchy :
{noformat}
-java
 |-- sca
     |-- demos                SCA demo applications
     |-- distribution         SCA distributions
     |-- itest                SCA Integration Tests
     |-- modules              SCA Implementation Modules (core, runtimes, contribution, extensions, etc)
     |-- samples              SCA Sample Applications
     |-- tools                SCA Tools (Eclipse plugins, wsdl2java, java2wsdl, etc)
     |-- tutorial             SCA Tutorial
{noformat}
The individual modules can be built separately or build with top-down build.

h4. top-down build (recommended approach)

Check out all of the java source code.
{code}
svn checkout http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x
{code}

Building the SCA source code is simple
{code}
cd sca-java-1.x/sca
mvn
{code}
It should work even if you start with an empty Maven local repository, and it should always work, however when you are building for Tuscany for the first time there are a lot of dependencies which must be downloaded so the first build can take a long time and it may fail with problems retrieving the dependencies. 

(on) There can be occasional problems downloading artifacts from remote Maven repositories so if mvn fails with network related sounding messages sometimes just trying again can fix the problem.

(on) The trunk code sometimes has SNAPSHOT dependencies which can get out of date in your local repository so if you see odd build failures try updating the SNAPSHOT jars with:
{code}
mvn -U
{code}

(on) Once you have done a top-down build, and your local maven repository is populated, you can start using the maven off line option to speed up the build process
{code}
mvn -o
{code}

{info}
   The SCA build consumes a good amount of memory, in case you are seeing issues during the build, set a MAVEN_OPTS environment variable to allocate more memory for the build process.

   Windows : SET MAVEN_OPTS=-Xmx512m
   Unix    : export MAVEN_OPTS=-Xmx512m

{info}

{info}

The "trunk" is always in very active development, and sometimes you might experience issues trying to build some modules, in that case you can tell maven to continue building other modules

{code}
mvn -fae clean install
{code}

or either skip all unit tests

{code}
mvn -fae -Dmaven.skip.test=true clean install
{code}

or run tests, but do not stop building if one of the tests fails

{code}
mvn -fn clean install
{code}
{info}

h4. {anchor:Distributions} Building the binary and source distributions

The binary and source distribution release artifacts are created by running maven in the distribution folder, for example:
{code}
cd java/sca/distribution
mvn clean install -o
{code}
The distribution artifacts can then be found in the folder named "target" within the distribution folder. 

h3. {anchor:IDE}Importing SCA modules into your Development IDE


h4. Using Eclipse

If this is the first time you are using your workspace with maven m2 local repository, you will need to tell your Eclipse workspace the location of the directory, and you can do this with the following command :
{code}
mvn -Declipse.workspace=[path-to-eclipse-workspace] eclipse:add-maven-repo
{code}
In order to generate the necessary project files to import the SCA modules to Eclipse, you can use the maven eclipse plugin
{code}
cd java/sca
mvn -Peclipse eclipse:eclipse
{code}
Now, launch your Eclipse IDE, select File->Import->Existing projects into Workplace, and then select the base SCA directory (e.g java/sca) and then press Finish, this should import all SCA modules into your Eclipse Workspace.

There are some Tuscany Eclipse code templates available:
[Eclipse Style Formatter | https://svn.apache.org/repos/asf/tuscany/java/etc/tuscany-eclipse-codestyle.xml ]
[Eclipse Templates | https://svn.apache.org/repos/asf/tuscany/java/etc/tuscany-eclipse-codetemplates.xml ]



h3. {anchor:Code Path} Understanding SCA code path

Here is a walk through of [key methods/functions|SCA Java Get Started with Coding] which help you get started with SCA Java development.

h3. {anchor:Coding Guidelines} Coding Guidelines

There are a few simple guidelines when developing for JAVA SCA:
* The basic coding style used is the described at [Sun Java coding standards|http://java.sun.com/docs/codeconv/] but the main thing is to be consistent with the existing code you're updating, so for example, if you're updating a method that uses the braces on the same line style don't add code with the hanging braces style.

* Always include the Apache License Headers on all files (both source code files and resource files such as xml documents)

* Include a descriptive log message for checkins, for example "fixed such and such problem".

Some other useful suggestions:
{panel:title=Clean Code|borderStyle=solid}
- use correct visibility, private, default, public, avoid protected
- make methods static if not using object state
- make sure javadoc is in sync or remove that javadoc
- no javadoc on overridden methods
- test cases in same package to avoid having to over-open access to methods
- don't create artificial dependencies by using constants from another module
- don't extend/implement a 'constant' interface
- avoid creating another private layer over a public interface/spi
- remove old code, don't leave it commented out, very confusing
- use functional programming names for functions that convert an object
- add javadoc to private methods
- review class javadoc and make sure it's accurate
- inline methods used only once, or make them clean static functions
- put utility methods in a Util class with package visibility
- use static imports
- use scoped variables
- no stars in OSGi exports
- correct use of generics, see the effective Java book
{panel}

{panel:title=Unit/Integration Tests|borderStyle=solid}
- put comments in test cases
- review test cases and make sure they're included in the build
- use junit 4 only, check correct use of @BeforeClass or @Before
- use static imports for assert statements
{panel}

{panel:title=Formatting|borderStyle=solid}
- use Tuscany eclipse code style/formatter
- no tabs
- no excessive line wrapping
{panel}

While Tuscany does not yet have an official style or template, here are some templates that folks have been using and have been checked into the build which are stored at [https://svn.apache.org/repos/asf/tuscany/java/etc/]

h4. Naming conventions to increase consistency

*Folder Names:* Please use all lowercases and dashes in folder names (like in the jar names)
- Maven artifact id = tuscany-<folder name>

*Package names:* Package names within modules should include the module name so that source code can be located in the source tree easily. So, for example, java/sca/module/implementation-java would be in package structure org.apache.tuscany.implementation.java.\*

h3. {anchor:Testing} Testing

Tuscany uses plain junit test cases to perform unit and integration testing, below is an example that can also be used as a template for writing new test cases; it demonstrates how to bootstrap the Tuscany SCA runtime in your test case, and because they are based on junit, you can run it from your IDE of choice or from Maven.
{code}
/**
 * Description of your test case and necessary details you find necessary
 */
public class YourTestCase extends TestCase {
    private SCADomain domain;
    private YourService service;


    @Override
    protected void setUp() throws Exception {
    	domain = SCADomain.newInstance("YourTest.composite");
        service = domain.getService(YourService.class, "serviceName");
    }

    @Override
    protected void tearDown() throws Exception {
    	domain.close();
    }


   ...
}
{code}
(on) Note that we use surefire maven plugin to run the unit and integration tests, and in most cases, they are configured to match a \**/*TestCase.java file name pattern. Because of this, if your test case has a different file name pattern, you might execute it from your IDE of choice, but the maven build won't execute the test.

h3. {anchor:Maven Build Structure} Maven Build Structure

_We use the term Module to refer to the leaf of maven tree._
* sca/pom.xml's parent will be pom/parent/pom.xml
* Other poms will use the pom from the parent folder as parent pom
* Group id: org.apache.tuscany.sca
* Version of our modules will be specified once in java/sca/pom.xml, child poms don't need specify a version as they get it from their parent
* pom names begin Apache Tuscany SCA
* Eclipse projects are generated for all built modules using mvn \-Peclipse eclipse:eclipse

h4. Adding a new module and not ready to integrate?

'work-in-progress' modules can be worked on in the same source tree and yet not break the top-down build. You can do this by not listing your module(s) in java/sca/modules/pom.xml.

h3. {anchor:Providing patches} Reporting issues and providing patches

{include: Found a Bug Section}
{HTMLcomment:hidden}{children:sort=creation}{HTMLcomment}

h2. Development Hints


h3. {anchor:Webapp in Eclipse} Generating Eclipse WTP Web Projects for Webapp samples

If you're using Eclipse WTP and want to get WTP Web Projects generated
for our Webapp samples you can simply pass a \-Dwtpversion=1.5 option to
the usual mvn eclipse:eclipse command, like this:
mvn \-Dwtpversion=1.5 \-Peclipse eclipse:eclipse

The magic \-Dwtpversion=1.5 option will add the WTP Web project nature to
all the Eclipse projects with <packaging>war</packaging> in their Maven
pom.xml. You'll then be able to add these projects to a WTP Tomcat or
Geronimo Server configuration, to publish and run them straight from
your Eclipse workspace.

h3:{anchor:Ant} Generating Dependencies for Ant in Samples

Figuring out the package dependency to include in Ant build.xml can be a pain. Here is a quick
script which works in Linux environment for war files.
{code}
jar tvf sample-feed-aggregator-webapp.war | grep .jar | awk '{ printf "%s\n", $8 }' | 
   sed -e "s/WEB-INF\/lib\///" | grep .jar | awk '{ printf "<include name=\"%s\"/>\n", $1$8 }' | grep -v tuscany
{code}

h2. {anchor:ReleaseChecklist} How tosed do a release of Tuscany?
Here is the [Checklist for doing a Tuscany SCA Java release | http://cwiki.apache.org/confluence/display/TUSCANY/Making+releases].-e "s/WEB-INF\/lib\///" | awk '{ printf "<include name=\"%s\"/>\n", $1 }' | grep -v tuscany
Column

Section