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 Background Color |
---|
| Importing SCA modules into your Development IDE |
Using EclipseIf 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-rep
|
In order to generate the necessary project files to import the SCA modules to Eclipse, you can use the maven eclipse plugin Code Block |
---|
cd java/sca
mvn -Peclipse eclipse:eclipse
|
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. Anchor |
---|
| Coding Guidelines |
---|
| Coding Guidelines |
---|
|
Background Color |
---|
| Coding Guidelines |
There are a few simple guidelines when developing for JAVA SCA: - Formatting standards are defined by the .checkstyle and .pmd configurations in the source repository. Please be sure to check code is formatted properly before doing a checkin (see below). If you are unfamiliar with Checkstyle or PMD, please see http://checkstyle.sourceforge.net/ and http://pmd.sourceforge.net/. Consistent formatting makes it easier for others to follow and allows diffs to work properly.
- Always include the Apache License Headers on all files and the following version tag:
Code Block |
---|
@version $Rev$ $Date$
|
- Please attempt to accompanied code with at least unit tests or verify it by existing tests before submitting a patch or checking in.
- Do not checkin IDE-specific resources such as project files.
- Prior to check-in, perform a clean build and run the complete battery of unit tests for the current module from the command line with Checkstyle enabled, as in:
Code Block |
---|
mvn clean
mvn -o -Psourcecheck
|
- Please do not perform a checkin using an IDE as doing so is frequently problematic.
- Include a descriptive log message for checkins, for example "fixed such and such problem".
Naming conventions to increase consistencyFolder 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.* All committs are expected to be accompanied by unit test and integration tests when appropriate. Unit tests should verify specific behavior relating to a single class or small set of related classes; integration tests verify code paths across subsystems. Testcases should be documented and clearly indicate what they verify. Also, avoid things that may cause side-effects when possible such as access of external resources. 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 Block |
---|
/**
* 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();
}
...
}
|
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. We encourage and follow continuous integration. Martin Fowler has a concise write-up here Anchor |
---|
| Maven Build Structure |
---|
| Maven Build Structure |
---|
|
Background Color |
---|
| 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
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. Anchor |
---|
| Providing patches |
---|
| Providing patches |
---|
|
Background Color |
---|
| Reporting issues and providing patches |
Include Page |
---|
| Found a Bug Section |
---|
| Found a Bug Section |
---|
|
|