The Java SCA sub-project aims to provide enterprise-grade service infrastructure based on SCA. Some of our principles include:
For those looking at or developing the Tuscany Java SCA source code this page provides some description of the code structure and associated conventions that are used.
The Java SCA project Subversion repository is located at https://svn.apache.org/repos/asf/incubator/tuscany/java/sca.
The respository can also be viewed online at http://svn.apache.org/viewvc/incubator/tuscany/java/
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.
Checking out from Subversion
Use a command like:
svn checkout https://svn.apache.org/repos/asf/incubator/tuscany/java/sca |
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.
Once your password is set, you can use a command like this to commit:
svn commit |
If Subversion can't figure out your username, you can tell it explicitly:
svn --username <name> commit |
Subversion will prompt you for a password, and once you enter it once, it will remember it for you. Note this is the password you configured with svnpasswd, not your shell or other password.
Prerequisites
Java SCA requires the following:
Module - we use the term module to refer to a leaf of the maven build tree. I.e a directory containing source code and resources that will be compiled to a releasable artifact, e.g. a jar file.
...
Looking at the source code for Java SCA you will see the following directory structure.
java/
pom/parent/pom.xml
...
sca/
pom.xml - The maven pom that builds all of the releasable Tuscany Java SCA modules
contrib/ - A temporary direcoty that holds modules not currently being developed or targetted for a release
...
doc/ - Tuscany Java SCA documentation that will be included with the release
...
itest/ - Integration tests that test system performace using combinations of Tuscany Java features
pom.xml
...
modules/ - A flat direcory structure holding all of the separate modules that make up Tuscany Java SCA.
pom.xml
...
samples/ - Tuscany Java SCA samples which show how to use the various features of the software
build.xml <-- Samples build with Ant as well as Maven - TBD
pom.xml
...
|
java/sca/module/implementation-java |
contains code in the package structure
org.apache.tuscany.implementation.java.* |
If people want to work on some new modules that won't be part of the
next release and are not included in the top-down build, that's fine, we can
just avoid listing these modules in java/sca/modules/pom.xml. So, they
can be there in the same source tree but they won't break the release
top-down build, and they won't have to be building at all times.
First of all check out all of the java source code.
svn checkout https://svn.apache.org/repos/asf/incubator/tuscany/java |
Building the SCA source code is simple
cd java/sca mvn |
It should work even if you start with an empty Maven local repository, and it should always work. This assumes that maven is able to retrieve a SNAPSHOT version of SDO (and of course the rest of software that SCA depends on) as we haven't built anything other than SCA here. 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.
Tuscany has some basic coding standards - use spaces not tabs, keep a reasonable line length, and include enough comments in the code. Tests are good, both unit and functional testing is encouraged. When modifying existing code try to use the style already in place or if necessary reformat the whole file so the style is consistent.
The ASF has some requirements on the license header that should be included in most files, for details see http://www.apache.org/legal/src-headers.html.
In the Tuscany SVN there is a folder tuscany/java/etc which contains various templates that can be used to configure your development environment, for example, codestyle template files which can be imported into the Eclipse or IDEA IDE's. Some Tuscany modules are set up to use the Maven Checkstyle facility which may be run using the Maven -Psourcecheck option.